Skip to content
Myr

express.js

This file

Path

lib/express.js

103 lines · 1.9 KiB · JavaScript

Last changed by

Merge tag '4.13.1'Douglas Christopher Wilsonbefore adoptionb309b87

History of this file

Take it

The walk stopped after 200 commits: lines older than 269dc53 point at it.

Merge tag '4.13.1'Douglas Christopher Wilsonbefore adoptionb309b87

lines 1–10why, one step back
1/*!
2 * express3 * Copyright(c) 2009-2013 TJ Holowaychuk4 * Copyright(c) 2013 Roman Shtylman5 * Copyright(c) 2014-2015 Douglas Christopher Wilson6 * MIT Licensed7 */89'use strict';10

Invoke router.param() only when route matchesDouglas Christopher Wilsonbefore adoption269dc53

lines 11–15why, one step back
11/**
12 * Module dependencies.13 */1415var EventEmitter = require('events').EventEmitter;

Merge tag '3.18.1'Douglas Christopher Wilsonbefore adoptionccc45a7

line 16why, one step back
16var mixin = require('merge-descriptors');

Invoke router.param() only when route matchesDouglas Christopher Wilsonbefore adoption269dc53

lines 17–40why, one step back
17var proto = require('./application');
18var Route = require('./router/route');19var Router = require('./router');20var req = require('./request');21var res = require('./response');2223/**24 * Expose `createApplication()`.25 */2627exports = module.exports = createApplication;2829/**30 * Create an express application.31 *32 * @return {Function}33 * @api public34 */3536function createApplication() {37 var app = function(req, res, next) {38 app.handle(req, res, next);39 };40

Merge tag '4.12.4'Douglas Christopher Wilsonbefore adoptionf90e045

lines 41–42why, one step back
41 mixin(app, EventEmitter.prototype, false);
42 mixin(app, proto, false);

Invoke router.param() only when route matchesDouglas Christopher Wilsonbefore adoption269dc53

lines 43–94why, one step back
43
44 app.request = { __proto__: req, app: app };45 app.response = { __proto__: res, app: app };46 app.init();47 return app;48}4950/**51 * Expose the prototypes.52 */5354exports.application = proto;55exports.request = req;56exports.response = res;5758/**59 * Expose constructors.60 */6162exports.Route = Route;63exports.Router = Router;6465/**66 * Expose middleware67 */6869exports.static = require('serve-static');7071/**72 * Replace removed middleware with an appropriate error message.73 */7475[76 'json',77 'urlencoded',78 'bodyParser',79 'compress',80 'cookieSession',81 'session',82 'logger',83 'cookieParser',84 'favicon',85 'responseTime',86 'errorHandler',87 'timeout',88 'methodOverride',89 'vhost',90 'csrf',91 'directory',92 'limit',93 'multipart',94 'staticCache',

Change req.query to a getterDouglas Christopher Wilsonbefore adoptiondcc4eaa

line 95why, one step back
95 'query',

Invoke router.param() only when route matchesDouglas Christopher Wilsonbefore adoption269dc53

lines 96–103why, one step back
96].forEach(function (name) {
97 Object.defineProperty(exports, name, {98 get: function () {99 throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');100 },101 configurable: true102 });103});