Skip to content
Myr

express.js

This file

Path

lib/express.js

65 lines · 1.1 KiB · JavaScript

Last changed by

remove last pieces of connect dependencyRoman Shtylmanbefore adoption1396e08

History of this file

Take it

The walk stopped after 200 commits: lines older than 916acd1 point at it.

replace 0.6.x travis with 0.10.xTJ Holowaychukbefore adoption916acd1

lines 1–4why, one step back
1/**
2 * Module dependencies.3 */4

remove app.router and refactor middleware processingRoman Shtylmanbefore adoptionf41d09a

lines 5–6why, one step back
5var EventEmitter = require('events').EventEmitter;
6

remove last pieces of connect dependencyRoman Shtylmanbefore adoption1396e08

line 7why, one step back
7var merge = require('merge-descriptors')

use utils-merge module to mixin object propertiesRoman Shtylmanbefore adoption718e68f

lines 8–10why, one step back
8 , mixin = require('utils-merge')
910var proto = require('./application')

replace 0.6.x travis with 0.10.xTJ Holowaychukbefore adoption916acd1

lines 11–15why, one step back
11 , Route = require('./router/route')
12 , Router = require('./router')13 , req = require('./request')14 , res = require('./response')15

remove last pieces of connect dependencyRoman Shtylmanbefore adoption1396e08

lines 16–18why, one step back
16// monkey patch ServerResponse methods
17require('./patch')18

replace 0.6.x travis with 0.10.xTJ Holowaychukbefore adoption916acd1

lines 19–32why, one step back
19/**
20 * Expose `createApplication()`.21 */2223exports = module.exports = createApplication;2425/**26 * Create an express application.27 *28 * @return {Function}29 * @api public30 */3132function createApplication() {

remove app.router and refactor middleware processingRoman Shtylmanbefore adoptionf41d09a

lines 33–36why, one step back
33 var app = function(req, res, next) {
34 app.handle(req, res, next);35 };36

use utils-merge module to mixin object propertiesRoman Shtylmanbefore adoption718e68f

line 37why, one step back
37 mixin(app, proto);

remove app.router and refactor middleware processingRoman Shtylmanbefore adoptionf41d09a

lines 38–39why, one step back
38 mixin(app, EventEmitter.prototype);
39

Merge pull request #1650 from printercu/masterTJ Holowaychukbefore adoptionaec3428

lines 40–41why, one step back
40 app.request = { __proto__: req, app: app };
41 app.response = { __proto__: res, app: app };

replace 0.6.x travis with 0.10.xTJ Holowaychukbefore adoption916acd1

lines 42–60why, one step back
42 app.init();
43 return app;44}4546/**47 * Expose the prototypes.48 */4950exports.application = proto;51exports.request = req;52exports.response = res;5354/**55 * Expose constructors.56 */5758exports.Route = Route;59exports.Router = Router;60

remove last pieces of connect dependencyRoman Shtylmanbefore adoption1396e08

lines 61–63why, one step back
61/**
62 * Expose middleware63 */

replace 0.6.x travis with 0.10.xTJ Holowaychukbefore adoption916acd1

line 64why, one step back
64

remove last pieces of connect dependencyRoman Shtylmanbefore adoption1396e08

line 65why, one step back
65exports.static = require('./middleware/static');