Skip to content
Myr

middleware.js

This file

Path

lib/middleware.js

32 lines · 633 bytes · JavaScript

Last changed by

Merge pull request #1650 from printercu/masterTJ Holowaychukbefore adoptionaec3428

History of this file

Take it

The walk stopped after 200 commits: lines older than 8ac3e80 point at it.

Merge branch 'master' of github.com:visionmedia/expressTJ Holowaychukbefore adoption8ac3e80

lines 1–19why, one step back
1
2/**3 * Module dependencies.4 */56var utils = require('./utils');78/**9 * Initialization middleware, exposing the10 * request and response to eachother, as well11 * as defaulting the X-Powered-By header field.12 *13 * @param {Function} app14 * @return {Function}15 * @api private16 */1718exports.init = function(app){19 return function expressInit(req, res, next){

change prev commit to use app.enabled()TJ Holowaychukbefore adoption8beb1f2

line 20why, one step back
20 if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');

Merge branch 'master' of github.com:visionmedia/expressTJ Holowaychukbefore adoption8ac3e80

lines 21–32why, one step back
21 req.res = res;
22 res.req = req;23 req.next = next;2425 req.__proto__ = app.request;26 res.__proto__ = app.response;2728 res.locals = res.locals || utils.locals(res);2930 next();31 }32};