Skip to content
Myr

Fixed param / key mapping

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

authored by visionmedia · committed by visionmedia · parent 2cb739d · Browse files · 2 files+4 added−3 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+4 added−3 removed

  • tests:+1 added−0 removed
  • other:+3 added−3 removed

2 files+4 added−3 removed

modified:lib/express.core.js+3 added-3 removed
266 unmodified lines
267 callRouteFor : function(request) {268 var route = this.findRouteFor(request) || this.defaultRoute269 if (route.keys)270 for (var i = 0, len = route.keys.length; i < len; ++i) 271 this.request.uri.params[route.keys[i]] = Express.captures[i] || null271 this.request.uri.params[route.keys[i]] = Express.captures[i+1] || null272 return this.eval(Express.contentsOf(route.callback))()273 },274 275 /**
77 unmodified lines
353post ('/users', function(){354 return 'Posted data'355})356357get ('/user/:name/edit', function(){358 return 'Editing user "' + (param('name') || 'none') + '"'357get ('/user/:name/:op', function(){358 return param('op') + ' user "' + (param('name') || 'none') + '"'359})360361Express.start()
modified:spec/spec.routing.js+1 added