express-enrouten
Advanced tools
Comparing version 1.1.0 to 1.1.1
30
index.js
@@ -64,25 +64,17 @@ /*───────────────────────────────────────────────────────────────────────────*\ | ||
// Setup app locals for use in handlers. | ||
// Do this way because app.locals has no prototype. One question this raises is, | ||
// should an app be able to use enrouten multiple times, and if so, should | ||
// app.locals.enrouten routes be merged? | ||
// https://github.com/visionmedia/express/blob/6775658ed5cbac13f2d24c89e23ed967ad6a66ba/lib/application.js#L68 | ||
if (!Object.prototype.hasOwnProperty.call(parent.locals, 'enrouten')) { | ||
Object.defineProperty(parent.locals, 'enrouten', { | ||
value: { | ||
parent.locals.enrouten = { | ||
routes: router.routes, | ||
routes: router.routes, | ||
path: function path(name, data) { | ||
var route; | ||
route = this.routes[name]; | ||
if (typeof route === 'string') { | ||
return reverend(route, data || {}); | ||
} | ||
return undefined; | ||
} | ||
path: function path(name, data) { | ||
var route; | ||
route = this.routes[name]; | ||
if (typeof route === 'string') { | ||
return reverend(route, data || {}); | ||
} | ||
}); | ||
} | ||
return undefined; | ||
} | ||
}; | ||
debug('mounting routes at', app.mountpath); | ||
@@ -89,0 +81,0 @@ debug(router.routes); |
@@ -50,3 +50,3 @@ 'use strict'; | ||
* @param router the express Router against which child routers are mounted | ||
* @returns {Function} the implementation function to provide to directory | ||
* @returns {Function} the implementation function to provide to direc`tory | ||
*/ | ||
@@ -53,0 +53,0 @@ function createFileHandler(router) { |
{ | ||
"name": "express-enrouten", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "An express route initialization and configuration module.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27423
14
330