Merge branch 'master' of github.com:visionmedia/express
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 · parents 78d9c98, 158f452 · Browse files · 3 files·+18 added−21 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+18 added−21 removed
- other:+18 added−21 removed
Provenance
- Commit
66d9a4a- Tree
7a0861f- Author
TJ Holowaychuk <tj@vision-media.ca>- Committer
TJ Holowaychuk <tj@vision-media.ca>- Parent 1
78d9c98- Parent 2
158f452
3 files changed+18 added−21 removed
modified:bin/express+16 added-16 removed
28 unmodified lines29 var path = program.args.shift() || '.';30 31 // end-of-line code32 33-var eol = 'win32' == os.platform() ? '\r\n' : '\n'33+var eol = os.EOL34 35 // Template engine36 37 program.template = 'jade';177 unmodified lines215 , ' , path = require(\'path\');'216 , ''217 , 'var app = express();'218 , ''219- , 'app.configure(function(){'220- , ' app.set(\'port\', process.env.PORT || 3000);'221- , ' app.set(\'views\', __dirname + \'/views\');'222- , ' app.set(\'view engine\', \':TEMPLATE\');'223- , ' app.use(express.favicon());'224- , ' app.use(express.logger(\'dev\'));'225- , ' app.use(express.bodyParser());'226- , ' app.use(express.methodOverride());{sess}'227- , ' app.use(app.router);{css}'228- , ' app.use(express.static(path.join(__dirname, \'public\')));'229- , '});'219+ , '// all environments'220+ , 'app.set(\'port\', process.env.PORT || 3000);'221+ , 'app.set(\'views\', __dirname + \'/views\');'222+ , 'app.set(\'view engine\', \':TEMPLATE\');'223+ , 'app.use(express.favicon());'224+ , 'app.use(express.logger(\'dev\'));'225+ , 'app.use(express.bodyParser());'226+ , 'app.use(express.methodOverride());{sess}'227+ , 'app.use(app.router);{css}'228+ , 'app.use(express.static(path.join(__dirname, \'public\')));'229 , ''231- , 'app.configure(\'development\', function(){'230+ , '// development only'231+ , 'if (\'development\' == app.get(\'env\')) {'232 , ' app.use(express.errorHandler());'233- , '});'233+ , '}'234 , ''235 , 'app.get(\'/\', routes.index);'236 , 'app.get(\'/users\', user.list);'237 , ''238 , 'http.createServer(app).listen(app.get(\'port\'), function(){'239- , ' console.log("Express server listening on port " + app.get(\'port\'));'239+ , ' console.log(\'Express server listening on port \' + app.get(\'port\'));'240 , '});'241 , ''242 ].join(eol);243 100 unmodified lines344 var pkg = {345 name: 'application-name'346 , version: '0.0.1'347 , private: true348- , scripts: { start: 'node app' }348+ , scripts: { start: 'node app.js' }349 , dependencies: {350 express: version351 }352 }70 unmodified linesmodified:lib/application.js+1 added-2 removed
32 unmodified lines33 app.init = function(){34 this.cache = {};35 this.settings = {};36 this.engines = {};37- this.viewCallbacks = [];37 this.defaultConfiguration();38 };39 40 /**362 unmodified lines403 methods.forEach(function(method){404 app[method] = function(path){405 if ('get' == method && 1 == arguments.length) return this.set(path);406 408- // if no router attacked yet, attach the router407+ // if no router attached yet, attach the router408 if (!this._usedRouter) this.use(this.router);409 410 // setup route411 this._router[method].apply(this._router, arguments);122 unmodified linesmodified:lib/utils.js+1 added-3 removed
27 unmodified lines28 * @api private29 */30 31 exports.locals = function(obj){32- obj.viewCallbacks = obj.viewCallbacks || [];33-32 function locals(obj){33 for (var key in obj) locals[key] = obj[key];34 return obj;35 };240 unmodified lines276 })277 .replace(/([\/.])/g, '\\$1')278 .replace(/\*/g, '(.*)');279 return new RegExp('^' + path + '$', sensitive ? '' : 'i');282-}280+}