Skip to content
Myr

prepping for connect 1.0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 2dd736a · Browse files · 2 files+27 added−20 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+27 added−20 removed

  • other:+27 added−20 removed

2 files+27 added−20 removed

modified:lib/express.js+14 added-7 removed
modified:lib/server.js+13 added-13 removed
7 unmodified lines
8/**9 * Module dependencies.10 */1112var url = require('url')13 , view = require('./view')12var queryString = require('querystring')13 , connect = require('connect')15 , utils = connect.utils16 , queryString = require('querystring')17 , router = require('connect').router18 , methods = router.methods.concat(['del', 'all']);14 , router = connect.router15 , methods = router.methods.concat(['del', 'all'])16 , view = require('./view')17 , url = require('url')18 , utils = connect.utils;1920/**21 * Initialize a new `Server` with optional `middleware`.22 *
8 unmodified lines
31 this.isCallbacks = {};32 this.viewHelpers = {};33 this.dynamicViewHelpers = {};34 this.errorHandlers = [];35 connect.Server.call(this, []);35 connect.HTTPServer.call(this, []);3637 // Default "home" to / 38 this.set('home', '/');39
36 unmodified lines
76 });77};7879/**80 * Inherit from `connect.Server`.80 * Inherit from `connect.HTTPServer`.81 */8283Server.prototype.__proto__ = connect.Server.prototype;83Server.prototype.__proto__ = connect.HTTPServer.prototype;8485/**86 * Support swappable querystring parsers.87 */
5 unmodified lines
93 */9495Server.prototype.listen = function(){96 this.registerErrorHandlers();97 connect.Server.prototype.listen.apply(this, arguments);97 connect.HTTPServer.prototype.listen.apply(this, arguments);98};99100/**101 * Proxy in order to register error handlers.102 */103104Server.prototype.listenFD = function(){105 this.registerErrorHandlers();106 connect.Server.prototype.listenFD.apply(this, arguments);106 connect.HTTPServer.prototype.listenFD.apply(this, arguments);107};108109/**110 * When using the vhost() middleware register error handlers.
20 unmodified lines
131 return this;132};133134/**135 * Proxy `connect.Server#use()` to apply settings to135 * Proxy `connect.HTTPServer#use()` to apply settings to136 * mounted applications.137 *138 * @param {String|Function|Server} route139 * @param {Function|Server} middleware
5 unmodified lines
145 if (typeof route !== 'string') {146 middleware = route, route = '/';147 }148149 connect.Server.prototype.use.call(this, route, middleware);149 connect.HTTPServer.prototype.use.call(this, route, middleware);150151 // Mounted an app152 if (middleware instanceof Server) {153 // Home is /:route/:home
305 unmodified lines