@axolo/egg-wechat

0.0.2 • Public • Published

egg-wechat

node-wechat plugin for Egg.js.

Install

npm i @axolo/egg-wechat --save

Usage

// {app_root}/config/plugin.js
exports.wechat = {
  enable: true,
  package: '@axolo/egg-wechat',
};

Configuration

// {app_root}/config/config.default.js
exports.wechat = {};

see https://github.com/axolo/node-wechat for more help. see config/config.default.js for more detail.

Example

const Controller = require('egg').Controller;

class WechatController extends Controller {
  async index() {
    const { app, ctx } = this;
    const { wechat } = app;
    const params = { openid: 'openid' };
    const result = await wechat.execute('/user/info', { params });
    ctx.body = result;
  }
}

module.exports = WechatController;

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i @axolo/egg-wechat

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

5.02 kB

Total Files

6

Last publish

Collaborators

  • axolo