#228 running dbgate on subpath

This commit is contained in:
Jan Prochazka
2022-02-24 14:42:37 +01:00
parent 07c7a0405a
commit 7112f930ae
5 changed files with 24 additions and 31 deletions

View File

@@ -0,0 +1,10 @@
function getExpressPath(path) {
path = path.replace(/\/*$/, '').replace(/^\/*/, '');
const root = (process.env.WEB_ROOT || '').replace(/^\/*/, '').replace(/\/*$/, '');
if (root) {
return `/${root}/${path}`;
}
return `/${path}`;
}
module.exports = getExpressPath;