fix breadcrumbs and home /api route not loading

This commit is contained in:
Baris Usakli
2017-11-15 14:48:28 -05:00
parent 6a623c30d7
commit 38e52a65be
6 changed files with 11 additions and 10 deletions

View File

@@ -37,7 +37,7 @@ pubsub.on('config:update', configUpdated);
configUpdated();
module.exports = function (req, res, next) {
if (req.path !== '/' && req.path !== '/api/') {
if (req.path !== '/' && req.path !== '/api/' && req.path !== '/api') {
return next();
}
@@ -56,7 +56,7 @@ module.exports = function (req, res, next) {
});
}
req.url = req.path + route;
req.url = req.path + (!req.path.endsWith('/') ? '/' : '') + route;
next();
});
};