Skip to content
Myr

express.js

This file

Path

lib/express.js

79 lines · 1.5 KiB · JavaScript

Last changed by

Merge tag '4.16.2'Douglas Christopher Wilsonbefore adoption62e12fe

History of this file

Take it

The walk stopped after 200 commits: lines older than e29fa25 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

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

lines 11–14why, one step back
11/**
12 * Module dependencies.13 */14

Merge tag '4.16.2'Douglas Christopher Wilsonbefore adoption62e12fe

line 15why, one step back
15var bodyParser = require('body-parser')

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

line 16why, one step back
16var EventEmitter = require('events').EventEmitter;

Merge tag '3.18.1'Douglas Christopher Wilsonbefore adoptionccc45a7

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

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

line 18why, one step back
18var proto = require('./application');

Use router module for routingDouglas Christopher Wilsonbefore adoptioncec5780

line 19why, one step back
19var Router = require('router');

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

lines 20–40why, one step back
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);

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

line 43why, one step back
43

Merge tag '4.15.0'Douglas Christopher Wilsonbefore adoption501e24e

lines 44–53why, one step back
44 // expose the prototype that will get set on requests
45 app.request = Object.create(req, {46 app: { configurable: true, enumerable: true, writable: true, value: app }47 })4849 // expose the prototype that will get set on responses50 app.response = Object.create(res, {51 app: { configurable: true, enumerable: true, writable: true, value: app }52 })53

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

lines 54–69why, one step back
54 app.init();
55 return app;56}5758/**59 * Expose the prototypes.60 */6162exports.application = proto;63exports.request = req;64exports.response = res;6566/**67 * Expose constructors.68 */69

Use router module for routingDouglas Christopher Wilsonbefore adoptioncec5780

line 70why, one step back
70exports.Route = Router.Route;

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

lines 71–76why, one step back
71exports.Router = Router;
7273/**74 * Expose middleware75 */76

Merge tag '4.16.2'Douglas Christopher Wilsonbefore adoption62e12fe

line 77why, one step back
77exports.json = bodyParser.json

Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25

line 78why, one step back
78exports.static = require('serve-static');

Merge tag '4.16.2'Douglas Christopher Wilsonbefore adoption62e12fe

line 79why, one step back
79exports.urlencoded = bodyParser.urlencoded