12345678910111213141516171819202122232425262728293031323334353637383940414243 |
-
-
- 'use strict';
-
-
-
- var setPrototypeOf = require('setprototypeof')
-
-
-
- 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;
-
- setPrototypeOf(req, app.request)
- setPrototypeOf(res, app.response)
-
- res.locals = res.locals || Object.create(null);
-
- next();
- };
- };
|