Skip to content
Myr

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

3 files+18 added−21 removed

modified:bin/express+16 added-16 removed
28 unmodified lines
29var path = program.args.shift() || '.';3031// end-of-line code3233var eol = 'win32' == os.platform() ? '\r\n' : '\n'33var eol = os.EOL3435// Template engine3637program.template = 'jade';
177 unmodified lines
215 , ' , 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 lines
344 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 lines
modified:lib/application.js+1 added-2 removed
32 unmodified lines
33app.init = function(){34 this.cache = {};35 this.settings = {};36 this.engines = {};37 this.viewCallbacks = [];37 this.defaultConfiguration();38};3940/**
362 unmodified lines
403methods.forEach(function(method){404 app[method] = function(path){405 if ('get' == method && 1 == arguments.length) return this.set(path);406408 // if no router attacked yet, attach the router407 // if no router attached yet, attach the router408 if (!this._usedRouter) this.use(this.router);409410 // setup route411 this._router[method].apply(this._router, arguments);
122 unmodified lines
modified:lib/utils.js+1 added-3 removed
27 unmodified lines
28 * @api private29 */3031exports.locals = function(obj){32 obj.viewCallbacks = obj.viewCallbacks || [];3332 function locals(obj){33 for (var key in obj) locals[key] = obj[key];34 return obj;35 };
240 unmodified lines
276 })277 .replace(/([\/.])/g, '\\$1')278 .replace(/\*/g, '(.*)');279 return new RegExp('^' + path + '$', sensitive ? '' : 'i');282}280}