Taken from: https://github.com/strongloop/express/blob/master/lib/express.js
function createApplication() {
var app = function(req, res, next) { // app here is a function
app.handle(req, res, next); // how is it that app can have properties? is this recursive?
};
mixin(app, proto);
mixin(app, EventEmitter.prototype);
app.request = { __proto__: req, app: app }; // property declaration
app.response = { __proto__: res, app: app }; // property declaration again
app.init();
return app;
}
Would appreciate primary source links for legitimacy sirs!