/*!1* express2* Copyright(c) 2009-2013 TJ Holowaychuk3* Copyright(c) 2013 Roman Shtylman4* Copyright(c) 2014-2015 Douglas Christopher Wilson5* MIT Licensed6*/78'use strict';910/**11* Module dependencies.12* @private13*/1415var setPrototypeOf = require('setprototypeof')1617/**18* Initialization middleware, exposing the19* request and response to each other, as well20* as defaulting the X-Powered-By header field.21*22* @param {Function} app23* @return {Function}24* @api private25*/2627exports.init = function(app){28return function expressInit(req, res, next){29if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');30req.res = res;31res.req = req;32req.next = next;3334setPrototypeOf(req, app.request)35setPrototypeOf(res, app.response)3637res.locals = res.locals || Object.create(null);3839next();40};41};42434445