Skip to content

Conversation

mdreamfly
Copy link

支持 restify 框架

ex:
var restify = require('restify');
var server = restify.createServer({});
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser());
server.use(restify.bodyParser());
server.post('/', wechat(config.wx,function(req,res,next){
console.log(req.weixin);
res.send('success');
}));

lib/wechat.js Outdated
if (stream.rawBody) {
callback(null, stream.rawBody);
// support restify req.body
if (stream.rawBody||stream.body) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var body = stream.rawBody || stream.body;
if (body) {

@mdreamfly mdreamfly closed this Feb 22, 2016
@JacksonTian
Copy link
Member

。。。为嘛要close?

@mdreamfly mdreamfly reopened this Feb 23, 2016
@mdreamfly
Copy link
Author

奇怪了。。。我没close啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants