@browserspy/common
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -126,2 +126,23 @@ "use strict"; | ||
.replace(/\/index$/, ''); | ||
var endpoints = controller.endpoints; | ||
if (Array.isArray(endpoints)) { | ||
endpoints.forEach(function (endpoint) { | ||
var handler = []; | ||
if (controller.before) { | ||
middlewareParser(handler, errorHandler(controller.before)); | ||
} | ||
handler.push.apply(handler, errorHandler(endpoint.handler)); | ||
if (controller.after) { | ||
middlewareParser(handler, errorHandler(controller.after)); | ||
} | ||
var method = endpoint.method.toLowerCase(); | ||
var url = "/" + name + endpoint.url; | ||
routes.push({ | ||
method: method, | ||
url: url, | ||
}); | ||
app[method](url, handler); | ||
}); | ||
delete controller.endpoints; | ||
} | ||
Object.keys(controller) | ||
@@ -128,0 +149,0 @@ .forEach(function (key) { |
{ | ||
"name": "@browserspy/common", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
22540
318