koa-wechat-signature

1.0.1 • Public • Published

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
  }
})

Package Sidebar

Install

npm i koa-wechat-signature

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

1.4 kB

Total Files

4

Last publish

Collaborators

  • raysix900202