3 * Copyright(c) 2009-2013 TJ Holowaychuk
4 * Copyright(c) 2013 Roman Shtylman
5 * Copyright(c) 2014-2015 Douglas Christopher Wilson
12 * Module dependencies.
16 var setPrototypeOf = require('setprototypeof')
19 * Initialization middleware, exposing the
20 * request and response to each other, as well
21 * as defaulting the X-Powered-By header field.
23 * @param {Function} app
28 exports.init = function(app){
29 return function expressInit(req, res, next){
30 if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
35 setPrototypeOf(req, app.request)
36 setPrototypeOf(res, app.response)
38 res.locals = res.locals || Object.create(null);