From 81283fd3c5fa274fa9a9fc153d6312ccaf4e5a37 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 11 Dec 2019 12:27:39 +0100 Subject: [PATCH] fix root not getting replaced --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 75c13b3..ced4d6e 100644 --- a/index.js +++ b/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, '/');