1234567891011121314151617181920212223242526 |
- exports.init = function(app){
- return function expressInit(req, res, next){
- if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
- req.res = res;
- res.req = req;
- req.next = next;
- req.__proto__ = app.request;
- res.__proto__ = app.response;
- res.locals = res.locals || Object.create(null);
- next();
- };
- };
|