1
0
Fork 0

Store path (pattern) in RequestContext#path.

This commit is contained in:
Alan Plum 2015-05-07 01:28:50 +02:00
parent 1cd0d0aa10
commit 0b410eb628
2 changed files with 9 additions and 9 deletions

View File

@ -148,13 +148,13 @@ extend(Controller.prototype, {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
handleRequest: function (method, route, callback) { handleRequest: function (method, route, callback) {
var constraints = {queryParams: {}, urlParams: {}}, var constraints = {queryParams: {}, urlParams: {}};
newRoute = internal.constructRoute(method, route, callback, this, constraints), var newRoute = internal.constructRoute(method, route, callback, this, constraints);
requestContext = new RequestContext( var requestContext = new RequestContext(
this.allRoutes, this.models, newRoute, this.rootElement, constraints, this.extensions this.allRoutes, this.models, newRoute, route, this.rootElement, constraints, this.extensions
), );
summary, var summary;
undocumentedBody; var undocumentedBody;
this.routingInfo.routes.push(newRoute); this.routingInfo.routes.push(newRoute);
@ -758,7 +758,6 @@ extend(Controller.prototype, {
/// ///
/// @endDocuBlock /// @endDocuBlock
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
extend: function(extensions) { extend: function(extensions) {
var attr; var attr;
for (attr in extensions) { for (attr in extensions) {

View File

@ -112,7 +112,8 @@ function validateOrThrow(raw, schema, allowInvalid) {
/// Used for documenting and constraining the routes. /// Used for documenting and constraining the routes.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
function RequestContext(executionBuffer, models, route, rootElement, constraints, extensions) { function RequestContext(executionBuffer, models, route, path, rootElement, constraints, extensions) {
this.path = path;
this.route = route; this.route = route;
this.typeToRegex = { this.typeToRegex = {
"int": "/[0-9]+/", "int": "/[0-9]+/",