Skip to content
Myr

Fixed routing

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

Screwed up by previously adding route.originalPath

authored by visionmedia · committed by visionmedia · parent 9ee808f · Browse files · 2 files+4 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

2 files+4 added−4 removed

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

2 files+4 added−4 removed

modified:lib/express.core.js+3 added-3 removed
527 unmodified lines
528 for (i = 0, len = route.keys.length; i < len; ++i) 529 this.request.uri.params[route.keys[i]] = Express.captures[i+1] || null530 var body = this.eval(Express.contentsOf(route.callback))531 if (typeof body != 'string') 532 throw "route `" + route.method.toUpperCase() + ' ' + route.originalPath + "' must return a string"532 throw "route `" + route.method.toUpperCase() + ' ' + route.path + "' must return a string"533 return body534 },535 536 /**
37 unmodified lines
574 575 routeFunctionFor : function(method) {576 return function(path, options, callback) {577 if (options.constructor == Function) callback = options, options = {}578 path = Express.pathToRegexp(Express.normalizePath(path))579 Express.routes.push({580 keys : Express.regexpKeys,580 path : Express.pathToRegexp(Express.normalizePath(path)),581 originalPath : path,581 path : path,582 method : method,583 options : options,584 callback : callback585 })
38 unmodified lines
modified:spec/spec.routing.js+1 added-1 removed