Skip to content
Myr

Allow dynamic mounting with `.use`.

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

Retains params from the parent application.

authored by Blake Embrey · committed by Blake Embrey · parent 76147c7 · Browse files · 3 files+10 added−6 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+10 added−6 removed

  • other:+10 added−6 removed

3 files+10 added−6 removed

modified:lib/router/index.js+7 added-3 removed
181 unmodified lines
182 options.push.apply(options, route._options());183 }184 }185186 req.params = layer.params;186 req.params = req.params || {};187188 for (var key in layer.params) {189 req.params[key] = layer.params[key];190 }191192 // this should be done for the layer193 return self.process_params(layer, req, res, function(err) {194 if (err) {195 return next(err);
51 unmodified lines
247proto.process_params = function(route, req, res, done) {248 var params = this.params;249250 // captured parameters from the route, keys and values247 var keys = route.keys || [];251 var keys = route.keys;252253 // fast track250 if (keys.length === 0) {254 if (!keys || keys.length === 0) {255 return done();256 }257258 var i = 0;
148 unmodified lines
modified:lib/router/layer.js+2 added-2 removed
modified:package.json+1 added-1 removed