egg-wechat-api-sql

1.0.7 • Public • Published

egg-wechat-api

NPM version build status Test coverage David deps Known Vulnerabilities npm download

egg plugin for wechat-api

Install

$ npm i egg-wechat-api --save

Prerequisite

Node.js >= 7.x

Usage

Dependencies

Configuration

// {app_root}/config/plugin.js
exports.wechatApi = {
  enable: true,
  package: 'egg-wechat-api',
};
// {app_root}/config/config.default.js
exports.wechatApi = {  
  appId: '',
  appSecret: '',
};

Redis is required !

see config/config.default.js for more detail.

Example

'use strict';

module.exports = app => {

  app.get('/', function* () {

    const { wechatApi } = app;

    try {
      const ticket = yield wechatApi.getTicket();
      this.status = 200;
      this.body = ticket;

    } catch (error) {
      this.status = 500;
      this.body = error;
    }
  });

};

Questions & Suggestions

Please open an issue here.

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.71latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.71
1.0.61
1.0.51
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i egg-wechat-api-sql

Weekly Downloads

8

Version

1.0.7

License

MIT

Last publish

Collaborators

  • isheng5