Merge pull request #74 from koajs/req-res-next
pass an optional `next` to app.callback()
This commit is contained in:
commit
1536d4df29
1 changed files with 2 additions and 2 deletions
|
@ -88,10 +88,10 @@ app.callback = function(){
|
||||||
var gen = compose(mw);
|
var gen = compose(mw);
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
return function(req, res){
|
return function(req, res, next){
|
||||||
var ctx = new Context(self, req, res);
|
var ctx = new Context(self, req, res);
|
||||||
|
|
||||||
co.call(ctx, gen)(ctx.onerror);
|
co.call(ctx, gen)(next || ctx.onerror);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue