Comparing version 0.3.1 to 0.4.0
16
index.js
@@ -29,3 +29,15 @@ var approot = process.env.PWD; | ||
var filters = (router.filters || []).map(function (item) { | ||
return require(path.join(fltrDir, item)); | ||
switch(typeof item) { | ||
case 'function': | ||
return item; | ||
case 'string': | ||
return require(path.join(fltrDir, item)); | ||
default: | ||
console.log('[rainbow]: Filter only support function or string of path.'); | ||
return null; | ||
} | ||
}).filter(function (item) { | ||
return !!item; | ||
}); | ||
@@ -54,3 +66,3 @@ | ||
if (router[method.toLowerCase()]) { | ||
console.log('npm rainbow: Lower case HTTP methods are deprecated. Please change "' + method + '" in file:' + file + ' to upper case.'); | ||
console.log('[rainbow]: Lower case HTTP methods are deprecated. Please change "' + method + '" in file:' + file + ' to upper case.'); | ||
} | ||
@@ -57,0 +69,0 @@ |
{ | ||
"name": "rainbow", | ||
"description": "Express router middleware for RESTful API base on certain folder path", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"author": "mytharcher <mytharcher@gmail.com>", | ||
@@ -6,0 +6,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
6943
61