node-weixin-auth
微信服务器Auth模块是(node-weixin-api 或者 node-weixin-express)的一个子项目。 它提供了几个重要的方法
tokenize: 用于跟服务器验证配置信息
determine: 用于自动tokenize所有的api请求,而不需要手动在超时时重新请求,通过设置GAP的时间,降低失败率
ips: 获取服务IP列表
ack: 用于服务器有效性验证
交流QQ群: 39287176
Installation
$ npm install --save node-weixin-auth
Usage
var nodeWeixinAuth = ;var settings = ; var app = id: '' secret: '' token: ''; // 调整TIME_GAP来避免重复请求// 默认是500秒,基本上不会出现失效的情况nodeWeixinAuthTIME_GAP = 60; //手动得到accessTokennodeWeixinAuth; //自动获得accessToken,并发送需要accessToken的请求nodeWeixinAuth; //获取服务器IPnodeWeixinAuth; //与微信对接服务器的验证var errors = errors;var request = ;var express = ;var bodyParser = ; var server = ; server;server; // 微信服务器返回的ack信息是HTTP的GET方法实现的server;
License
Apache-2.0 © node-weixin