Enabling static files somewhere else
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user