diff --git a/package.json b/package.json index 78fdab8..f230c67 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wkitd", - "version": "1.3.1", + "version": "1.3.2", "type": "module", "main": "dist/index.js", "files": [ diff --git a/src/router/router-engine.js b/src/router/router-engine.js index f4d0bf7..a7489df 100644 --- a/src/router/router-engine.js +++ b/src/router/router-engine.js @@ -64,7 +64,7 @@ class Router { re = route.path.replace( RULE_REGEXP, - function (m, _prefix, _var, _require) { + function (m, _prefix, _var, _require = '') { vars.push(_var.slice(1)) if (_prefix === '/') { _prefix = '/?' @@ -116,6 +116,7 @@ class Router { } for (let [k, route] of this.#tables) { + console.log(route, path.match(route.regexp)) let args = path.match(route.regexp) if (args) { let params = Object.create(null)