0.4.0 • Published 6 years ago
fastify-wechat v0.4.0
fastify-wechat
Install
npm install fastify-wechat --save
Usage
Example:
const fastify = require('fastify');
fastify.register(require('fastify-wechat'), {
mp: {
appid: 'mp appid',
secret: 'mp secret',
},
open: {
appid: 'open appid',
secret: 'open secret',
},
});
fastify.get('/goWechatLogin', async (req, reply) => {
const redirectUrl = 'http://domain.com/wxconnect';
return await fastify.wechat.getAuthorizeUrl(redirectUrl);
});