Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 831 Bytes

README.md

File metadata and controls

51 lines (38 loc) · 831 Bytes

egg-leadcloud

LeanCloud JavaScript SDK for egg framework

Install

$ npm install egg-leancloud --save

Configuration

Change ${app_root}/config/plugin.js to enable leadcloud plugin:

exports.AV = {
  enable: true,
  package: 'egg-leancloud',
};

Configure LeadCloud information in ${app_root}/config/config.default.js:

exports.AV = {
  // leanCloud configuration
  client: {
    appId: 'your leanCloud appId',
    appKey: 'your leanCloud appKey',
  },
  // load into app, default is open
  app: true,
  // load into agent, default is close
  agent: false,
};

Usage:

app.AV // you can access to simple leanCloud instance by using app.AV

CURD User Guide

query example

const query = new app.AV.Query('TestObject');
const list = yield query.find();