Skip to content
Myr

"home" setting defaults to Server#route. Closes #363

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 51ebc88 · Browse files · 2 files+8 added−0 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+8 added−0 removed

  • tests:+2 added−0 removed
  • other:+6 added−0 removed

2 files+8 added−0 removed

modified:lib/express/server.js+6 added
67 unmodified lines
68 * @api public69 */7071Server.prototype.listen = function(port, host){72 // Default "home" to the mounted route or '/'73 if (!this.set('home')) {74 this.set('home', this.route || '/');75 }7677 // Set "env" to {EXPRESS,CONNECT}_ENV78 this.set('env', process.env.EXPRESS_ENV || process.connectEnv.name);79 this.runConfig('any', this.set('env'));8081 // Setup view reloading
154 unmodified lines
modified:test/express.test.js+2 added
229 unmodified lines
230 app.use('/blog', blog);231 assert.equal('/blog', blog.route);232 233 app.get('/', function(req, res){234 assert.equal('/', app.set('home'), "home did not default /");235 assert.equal('/blog', blog.set('home'), "home did not default to Server#route when mounted");236 res.send('main app');237 });238239 blog.get('/', function(req, res){
21 unmodified lines