fix: fix the bug with "path.replace" not being a function when adding middleware for Express router
This commit is contained in:
parent
17188eb870
commit
a8269e9057
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ function svrouter() {
|
|||
} else if (middleware && typeof path !== "string") {
|
||||
throw new Error("The path must be a string.");
|
||||
}
|
||||
const realPath = realMiddleware ? path.replace(/\/+$/, "") : "";
|
||||
const realPath = middleware ? path.replace(/\/+$/, "") : "";
|
||||
|
||||
const callback = (req, res, logFacilities, config, next) => {
|
||||
const previousReqBaseUrl = req.baseUrl;
|
||||
|
|
Loading…
Reference in a new issue