egg-leancloud
Install
$ npm i egg-leancloud --save
Usage
// {app_root}/config/plugin.jsexportsleancloud = enable: true package: 'egg-leancloud';
Configuration
// {app_root}/config/config.default.jsexportsleancloud = appId: '' appKey: '' masterKey: '';
You can config this at config.local.js
and leave config.default.js
empty, then will auto read config from process.env
.
see config/config.default.js for more detail.
Example
app start point:
// {app_root}/app.js // adjust egg env by LeanCloud envif !processenvEGG_SERVER_ENV // start app;
use LeanCloud api at controller:
// {app_root}/app/controller/news.jsexports { const avQuery = 'News'; ctxbody = avQuery;};
use LeanCloud api at start:
// {app_root}/app.jsmodule { app;};
Questions & Suggestions
Please open an issue here.