mirror of https://gitee.com/bigwinds/arangodb
Store path (pattern) in RequestContext#path.
This commit is contained in:
parent
1cd0d0aa10
commit
0b410eb628
|
@ -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) {
|
||||||
|
|
|
@ -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]+/",
|
||||||
|
|
Loading…
Reference in New Issue