Enabling static files somewhere else

This commit is contained in:
Thomas Forgione
2017-09-30 11:48:28 +02:00
parent 5ad9d41eca
commit a6753d9f44
4 changed files with 15 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
const config = require('settings/config');
let urls = {};
class Url {
@@ -13,12 +15,18 @@ function getUrl(name) {
return urls[name].url;
}
function getStatic(name) {
return config.STATIC_URL + name
}
module.exports = function(req, res, next) {
res.locals.getUrl = getUrl;
res.locals.getStatic = getStatic;
return next();
}
module.exports.getUrl = getUrl;
module.exports.getStatic = getStatic;
module.exports.url = function(url, viewName, urlName, method) {
let ret = new Url(url, viewName, urlName, method);