Comparing version 2.2.25 to 2.2.26
@@ -34,5 +34,3 @@ "use strict"; | ||
else { | ||
// matchedClass.serveFiles(() => { | ||
return allMiddleWares[nexted](req, res, next); | ||
// }); | ||
} | ||
@@ -39,0 +37,0 @@ } |
@@ -73,3 +73,4 @@ "use strict"; | ||
this.globalMiddleWares = this.globalMiddleWares || []; | ||
path = `${this.base}/${path}`.replace(/(https?:\/\/)|(\/)+/g, "$1$2"); | ||
path = `${this.base}/${path}`.replace(/(https?:\/\/)|(\/)+/g, "$1$2").replace(/^(.+?)\/*?$/, "$1") | ||
.replace(/\s+/gi, ""); | ||
const pattern = new url_pattern_1.default(path); | ||
@@ -79,3 +80,6 @@ const applyMiddleWares = (comingMiddleWares) => { | ||
const middleWare = (req, res, next) => { | ||
// console.log('yes checking middleWare'); | ||
// console.log(pattern, req.pathname); | ||
if (pattern.match(req.pathname)) { | ||
// console.log('matched'); | ||
func(req, res, next); | ||
@@ -82,0 +86,0 @@ } |
{ | ||
"name": "grandjs", | ||
"version": "2.2.25", | ||
"version": "2.2.26", | ||
"description": "A backend framework for solid web apps based on node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -47,3 +47,2 @@ /** | ||
} else { | ||
// matchedClass.serveFiles(() => { | ||
return allMiddleWares[nexted]( | ||
@@ -54,3 +53,2 @@ req, | ||
); | ||
// }); | ||
} | ||
@@ -57,0 +55,0 @@ } |
@@ -73,3 +73,4 @@ /** | ||
this.globalMiddleWares = this.globalMiddleWares || []; | ||
path = `${this.base}/${path}`.replace(/(https?:\/\/)|(\/)+/g, "$1$2"); | ||
path = `${this.base}/${path}`.replace(/(https?:\/\/)|(\/)+/g, "$1$2").replace(/^(.+?)\/*?$/, "$1") | ||
.replace(/\s+/gi, ""); | ||
const pattern = new RouteParser(path); | ||
@@ -79,3 +80,6 @@ const applyMiddleWares = (comingMiddleWares: MiddleWareInterface[]) => { | ||
const middleWare = (req: Request, res: Response, next: Function) => { | ||
// console.log('yes checking middleWare'); | ||
// console.log(pattern, req.pathname); | ||
if (pattern.match(req.pathname)) { | ||
// console.log('matched'); | ||
func(req, res, next); | ||
@@ -82,0 +86,0 @@ } else { |
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
5706
261554
58