fix root not getting replaced
This commit is contained in:
parent
0ca4e754cb
commit
81283fd3c5
2
index.js
2
index.js
@ -14,7 +14,7 @@ module.exports = function (app, modulefolder, opts = {}, subdir = '') {
|
||||
let [, method, url] = regex.exec(f);
|
||||
url = '/' + subdir + '/' + url + '/';
|
||||
url = url
|
||||
.replace(/^\/root/i, '/')
|
||||
.replace(/^\/[^/]*\/root/i, '/')
|
||||
.replace(/\./g, '/')
|
||||
.replace(/\/+/g, '/');
|
||||
|
||||
|
Reference in New Issue
Block a user