Skip to content
Myr

express.js

This file

Path

lib/express.js

82 lines · 1.4 KiB · JavaScript

Last changed by

deprecate things with depd moduleDouglas Christopher Wilsonbefore adoption9c731f1

History of this file

Take it

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

Merge pull request #1836 from fluxusfrequency/patch-1Roman Shtylmanbefore adoption2939075

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

deprecate things with depd moduleDouglas Christopher Wilsonbefore adoption9c731f1

line 5why, one step back
5var deprecate = require('depd')('express');

expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb

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

Merge pull request #1836 from fluxusfrequency/patch-1Roman Shtylmanbefore adoption2939075

lines 7–47why, one step back
7var connect = require('connect')
8 , proto = require('./application')9 , Route = require('./router/route')10 , Router = require('./router')11 , req = require('./request')12 , res = require('./response')13 , utils = connect.utils;1415/**16 * Expose `createApplication()`.17 */1819exports = module.exports = createApplication;2021/**22 * Expose mime.23 */2425exports.mime = connect.mime;2627/**28 * Create an express application.29 *30 * @return {Function}31 * @api public32 */3334function createApplication() {35 var app = connect();36 utils.merge(app, proto);37 app.request = { __proto__: req, app: app };38 app.response = { __proto__: res, app: app };39 app.init();40 return app;41}4243/**44 * Expose connect.middleware as express.*45 * for example `express.logger` etc.46 */47

expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb

line 48why, one step back
48merge(exports, connect.middleware);

Merge pull request #1836 from fluxusfrequency/patch-1Roman Shtylmanbefore adoption2939075

lines 49–50why, one step back
49
50/**

Add standard deprecation utilityDouglas Christopher Wilsonbefore adoption8dc4ff2

line 51why, one step back
51 * Deprecated createServer().

Merge pull request #1836 from fluxusfrequency/patch-1Roman Shtylmanbefore adoption2939075

lines 52–53why, one step back
52 */
53

deprecate things with depd moduleDouglas Christopher Wilsonbefore adoption9c731f1

line 54why, one step back
54exports.createServer = deprecate.function(createApplication,

Add standard deprecation utilityDouglas Christopher Wilsonbefore adoption8dc4ff2

lines 55–62why, one step back
55 'createServer() is deprecated\n' +
56 'express applications no longer inherit from http.Server\n' +57 'please use:\n' +58 '\n' +59 ' var express = require("express");\n' +60 ' var app = express();\n' +61 '\n'62);

Merge pull request #1836 from fluxusfrequency/patch-1Roman Shtylmanbefore adoption2939075

lines 63–82why, one step back
63
64/**65 * Expose the prototypes.66 */6768exports.application = proto;69exports.request = req;70exports.response = res;7172/**73 * Expose constructors.74 */7576exports.Route = Route;77exports.Router = Router;7879// Error handler title8081exports.errorHandler.title = 'Express';82