UNPKG

dbgate-api

Version:

Allows run DbGate data-manipulation scripts.

11 lines (9 loc) 278 B
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;