Files
SCM-Manager/scm-ui/scripts/ContextPathMiddleware.js
2019-10-07 17:06:00 +02:00

12 lines
273 B
JavaScript

function crateContextPathMiddleware(contextPath) {
return function(req, resp, next) {
const url = req.url;
if (url.indexOf(contextPath) === 0) {
req.url = url.substr(contextPath.length);
}
next();
}
}
module.exports = crateContextPathMiddleware;