Skip to content
Myr

express.js

This file

Path

lib/express.js

81 lines · 1.6 KiB · JavaScript

Last changed by

fix(refactor): prefix built-in node module importsSzymon Łągiewkabefore adoption4111359

History of this file

Take it

The walk stopped after 200 commits: lines older than 2a0c35a 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 callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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')

fix(refactor): prefix built-in node module importsSzymon Łągiewkabefore adoption4111359

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

Merge tag '3.18.1'Douglas Christopher Wilsonbefore adoptionccc45a7

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

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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');

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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);

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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;

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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

Merge tag '4.17.1'Douglas Christopher Wilsonbefore adoption121fe99

line 78why, one step back
78exports.raw = bodyParser.raw

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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

Merge tag '4.17.1'Douglas Christopher Wilsonbefore adoption121fe99

line 80why, one step back
80exports.text = bodyParser.text

Merge tag '4.16.2'Douglas Christopher Wilsonbefore adoption62e12fe

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