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
Provenance
- Commit
bdbacb4- Tree
dd3133c- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
2dd736a
2 files changed+27 added−20 removed
modified:lib/express.js+14 added-7 removed
4 unmodified lines567891011121314151617181920212216232425262728293031252627282930323334354 unmodified lines404142434445464748495051525312 unmodified lines4 unmodified lines * MIT Licensed */
/** * Module dependencies. */
var connect = require('connect') , Server = require('./server');
/** * Re-export connect auto-loaders. * * This prevents the need to `require('connect')` in order * to access core middleware, so for example `express.logger()` instead * of `require('connect').logger()`. */
var exports = module.exports = require('connect').middleware;var exports = module.exports = connect.middleware;
/** * Framework version. */
exports.version = '2.0.0-pre';
/** * Module dependencies. */
var Server = exports.Server = require('./server');
/** * Shortcut for `new Server(...)`. * * @param {Function} ... * @return {Server}4 unmodified lines return new Server(Array.prototype.slice.call(arguments));};
/** * Expose `Server`. */
exports.Server = Server;
/** * View extensions. */
require('./view');12 unmodified linesmodified:lib/server.js+13 added-13 removed
7 unmodified lines8 /**9 * Module dependencies.10 */11 12-var url = require('url')13- , view = require('./view')12+var 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;19 20 /**21 * Initialize a new `Server` with optional `middleware`.22 *8 unmodified lines31 this.isCallbacks = {};32 this.viewHelpers = {};33 this.dynamicViewHelpers = {};34 this.errorHandlers = [];35- connect.Server.call(this, []);35+ connect.HTTPServer.call(this, []);36 37 // Default "home" to / 38 this.set('home', '/');39 36 unmodified lines76 });77 };78 79 /**80- * Inherit from `connect.Server`.80+ * Inherit from `connect.HTTPServer`.81 */82 83-Server.prototype.__proto__ = connect.Server.prototype;83+Server.prototype.__proto__ = connect.HTTPServer.prototype;84 85 /**86 * Support swappable querystring parsers.87 */5 unmodified lines93 */94 95 Server.prototype.listen = function(){96 this.registerErrorHandlers();97- connect.Server.prototype.listen.apply(this, arguments);97+ connect.HTTPServer.prototype.listen.apply(this, arguments);98 };99 100 /**101 * Proxy in order to register error handlers.102 */103 104 Server.prototype.listenFD = function(){105 this.registerErrorHandlers();106- connect.Server.prototype.listenFD.apply(this, arguments);106+ connect.HTTPServer.prototype.listenFD.apply(this, arguments);107 };108 109 /**110 * When using the vhost() middleware register error handlers.20 unmodified lines131 return this;132 };133 134 /**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} middleware5 unmodified lines145 if (typeof route !== 'string') {146 middleware = route, route = '/';147 }148 149- connect.Server.prototype.use.call(this, route, middleware);149+ connect.HTTPServer.prototype.use.call(this, route, middleware);150 151 // Mounted an app152 if (middleware instanceof Server) {153 // Home is /:route/:home305 unmodified lines