Skip to content
Myr

Merge branch 'integration'

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 f4a0809, acc28c6 · Browse files · 2 files+12 added−1 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+12 added−1 removed

  • tests:+5 added−0 removed
  • other:+7 added−1 removed

2 files+12 added−1 removed

modified:lib/express/server.js+7 added-1 removed
129 unmodified lines
130 var app = middleware,131 home = app.set('home');132 if (home === '/') home = '';133 app.set('home', (app.route || '') + home);134 app.parent = this;135 // Mounted hook136 if (app.__mounted) app.__mounted.call(app, this);137 }138
81 unmodified lines
220};221222/**223 * Assign `setting` to `val`, or return `setting`'s value.224 * Mounted servers inherit their parent server's settings.225 *226 * @param {String} setting227 * @param {String} val228 * @return {Server|Mixed} for chaining, or the setting value
1 unmodified line
230 */231232Server.prototype.set = function(setting, val){233 if (val === undefined) {234 if (this.settings.hasOwnProperty(setting)) {232 return this.settings[setting];235 return this.settings[setting];236 } else if (this.parent) {237 return this.parent.set(setting);238 }239 } else {240 this.settings[setting] = val;241 return this;242 }
71 unmodified lines
modified:test/express.test.js+5 added
286 unmodified lines
287 app.use('/contact', map);288 assert.equal('/blog', blog.route);289 assert.equal('/contact', map.route);290 assert.ok(called, 'mounted() hook failed');291292 app.set("test", "parent setting");293 assert.equal(blog.set("test"), "parent setting", "settings did not inherit from parent app")294 blog.set("test", "overridden");295 assert.equal(blog.set("test"), "overridden", "mounted app setting did not override parent app")296 297 app.get('/', function(req, res){298 assert.equal('/', app.set('home'), "home did not default to /");299 assert.equal('/blog', blog.set('home'), "home did not default to Server#route when mounted");
26 unmodified lines