This commit is contained in:
Timo Hocker 2020-01-08 08:47:35 +01:00
parent bed627ad82
commit eabb5705bd

View File

@ -27,8 +27,12 @@ module.exports = function main (
for (const f of fs.readdirSync (modulefolder)) {
const regex = /(?<method>.*?)-(?<url>.*?)\.js/u;
const { groups } = regex.exec (f);
if ('undefined' !== typeof subdir)
if ('undefined' === typeof subdir)
groups.url = `/${groups.url}/`;
else
groups.url = `/${subdir}/${groups.url}/`;
groups.url = groups.url
.replace (/^\/[^/]*\/root/iu, '/')
.replace (/\./gu, '/')