wx-auth
v0.0.2
Published
An auth middleware for weixin.
Downloads
5
Readme
wx_auth
A simple middleware used to auth weixin
for connect
or express
. Optionally you need pass a token
string to wxAuth()
.
Installation
$ npm install wx-auth
API
var connect = require("connect");
var wxAuth = require("wx-auth");
var app = connect();
var TOKEN = "af5a20925f71c2c1d5c3b25cf9d676e468336fbc";
app.use(wxAuth(TOKEN));
wxAuth(token)
token
Thetoken
string you set in your weixin platform manage center.
Example
var express = require("express");
var wxAuth = require("wx-auth");
var app = express();
var TOKEN = "af5a20925f71c2c1d5c3b25cf9d676e468336fbc";
app.use(wxAuth(TOKEN));
app.get("/", function(req, res){
res.end(req.query.echostr);
});