Skip to content
Myr

Evaluating in context of Express

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

authored by visionmedia · committed by visionmedia · parent 4b36c4f · Browse files · 1 file+5 added−4 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+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:lib/express.core.js+5 added-4 removed
151 unmodified lines
152 // uri.relative153 // uri.source154 // uri.params155 // headers [[foo, bar]]156 return (this.findRouteFor(request) || this.defaultRoute).callback(Express.passToRoute)156 var route = this.findRouteFor(request) || this.defaultRoute157 return eval('function(){ with (Express){' + Express.contentsOf(route.callback) + '}}')()158 },159 160 findRouteFor : function(request) {161 for (var i = 0, len = this.routes.length; i < len; ++i)
6 unmodified lines
168 switch (route.path.constructor) {169 case String: return route.path == request.uri.path170 case RegExp: 171 if (captures = request.uri.path.match(route.path))171 return Express.passToRoute = captures172 return Express.captures = captures173 }174 },175 176 routeFunctionFor : function(method) {
15 unmodified lines
192get ('/users', function(){193 return 'List of users'194})195195get (/foo(bar)?/, function(captures){196 Express.dump(captures)196get (/foo(bar)?/, function(){197 dump(captures)198 return 'test'199})200201post ('/users', function(){
4 unmodified lines