Skip to content
Myr

mounted apps settings now inherited from parent app

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Aaron Heckmann · committed by Tj Holowaychuk · parent f4a0809 · Browse files · 1 file+7 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

1 file+7 added−1 removed

  • other:+7 added−1 removed

1 file+7 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 var app = this;235 do {236 if (app.settings.hasOwnProperty(setting))232 return this.settings[setting];237 return app.settings[setting];238 } while (app = app.parent);239 } else {240 this.settings[setting] = val;241 return this;242 }
71 unmodified lines