An open API service indexing awesome lists of open source software.

https://github.com/killme2008/ping-leancloud

Ping LeanCloud
https://github.com/killme2008/ping-leancloud

Last synced: 10 months ago
JSON representation

Ping LeanCloud

Awesome Lists containing this project

README

          

# Node.js Getting started

一个简单的使用 Express 4 的 Node.js 应用。
可以运行在 LeanEngine Node.js 运行时环境。

## 一键部署
[![Deploy to LeanEngine](http://ac-32vx10b9.clouddn.com/109bd02ee9f5875a.png)](https://leancloud.cn/1.1/functions/_ops/deploy-button)

## 本地运行

首先确认本机已经安装 [Node.js](http://nodejs.org/) 运行环境和 [LeanCloud 命令行工具](https://www.leancloud.cn/docs/leanengine_cli.html),然后执行下列指令:

```
$ git clone git@github.com:leancloud/node-js-getting-started.git
$ cd node-js-getting-started
```

安装依赖:

```
npm install
```

关联应用:

```
lean app add origin
```

这里的 appId 填上你在 LeanCloud 上创建的某一应用的 appId 即可。origin 则有点像 Git 里的 remote 名称。

启动项目:

```
lean up
```

应用即可启动运行:[localhost:3000](http://localhost:3000)

## 部署到 LeanEngine

部署到预备环境(若无预备环境则直接部署到生产环境):
```
lean deploy
```

将预备环境的代码发布到生产环境:
```
lean publish
```

## 相关文档

* [LeanEngine 指南](https://leancloud.cn/docs/leanengine_guide-node.html)
* [JavaScript 指南](https://leancloud.cn/docs/js_guide.html)
* [JavaScript SDK API](https://leancloud.cn/api-docs/javascript/index.html)
* [命令行工具详解](https://leancloud.cn/docs/cloud_code_commandline.html)
* [LeanEngine FAQ](https://leancloud.cn/docs/cloud_code_faq.html)