maoruibin / maoruibin/maoruibin.github.com

LeanCloud 云引擎使用体验

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

笔记
Dominant language
HTML
Stars
22
Forks
4
PR merge metrics
No merged PRs in 30d

Description

在开始说之前,先说一下 LeanCloud。

LeanCloud 领先的 BaaS 提供商,为移动开发提供强有力的后端支持.

一开始 LeanCloud 只提供数据存储服务,也就是一个纯粹的后台数据提供方,相当于有了自己的服务器,但是功能也有限制,不能自定义一些查询,所有的数据增删改查都是 leancloud 提供。

所以后来就有了今天的 LeanCloud 云引擎,使用它开发者就可以自定义自己的业务逻辑在里面,也可以开发自己的 api, 比如我现在就在上面完成了一个 API, 用于获取一串歪说 api 地址如下

http://waishuo.leanapp.cn/waishuos/listone

具体可以点击访问。下面进入正题。

什么是 LeanCloud 云引擎

云引擎(LeanEngine)是 LeanCloud 推出的服务端托管平台。提供了多种运行环境(如 Node.js, Python 等)来运行服务端程序。你只需要提供服务端的业务逻辑(网站或云函数等),而服务端的多实例负载均衡,不中断服务的平滑升级等都由云引擎提供支持。

它主要可以提供如下服务

网站托管

网站托管是云引擎的一个子模块,允许你用开发一个 Web 程序,提供云函数和 Hook,还可以提供静态文件的托管和自定义的路由、绑定你自己的域名。你可以用它为你的移动应用提供一个介绍和下载页、开发一个管理员控制台或完整的网站,或者运行一些必须在服务器端运行的自定义逻辑。

以前可能需要自己有服务器才可以搭建自己的 Web 程序,现在用 LeanCloud 云引擎就可以搞定。或者你现在要开发一个小程序,但是没有 server,这是 LeanCloud 都可以完成后端的工作。

云函数

暂时不是很理解。

如何使用

官方文档
现在 LeanCLoud 已经提供了一个模板可以快速生成一个 Web ToDo 程序,下面选择 Python 进行开发。最终会把这个应用开发完成,并部署在 leancloud.

首先安装leancloud-cli ,它是整个操作的核心。

brew install lean-cli

接着本地创建一个名为 Todo 的文件夹,然后 cd 到该文件夹下

lean init

初始化后,项目中会自动创建出很多文件夹,这都是 leancloud-cli 帮我们创建好的,接下来需要安装项目运行需要的依赖

npm install

安装完没问题后,运行

lean up

接着打开浏览器访问 http://localhost:3000 会显示已经成功运行的 TODO

部署

lean deploy

使用总结

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the issue body and its linked LeanCloud quickstart and CLI documentation first. The intended article scope and target location are not specified, so clarify what should be added or changed before starting; completion cannot be verified from the issue alone.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, python
Domain
content, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.