1.0.1 • Published 6 years ago
koa-wechat-signature v1.0.1
HOW TO USE
const { wechatSignature }= require('koa-wechat-signature')
app.use(wechatSignature({
token, // YOUR TOKEN
path //YOUR PATH . Default '/'
}))
NOW USE
app.use(async (ctx, next) => {
// when valid success, the echostr key will be in ctx.request.wechat
if (ctx.method === 'GET') {
ctx.body = ctx.request.wechat.echostr || false
}
})