diff options
author | Christoph (Sheogorath) Kern | 2018-10-05 22:21:01 +0200 |
---|---|---|
committer | GitHub | 2018-10-05 22:21:01 +0200 |
commit | 32af96aa376576d060e16a2c0ff7ed5719d24e91 (patch) | |
tree | 16fe3f008e22d79a0f55af4357850c3ad24f2345 /lib/web | |
parent | f186f733736a1e73fece235ef4952de7b703ec6c (diff) | |
parent | 61e240192e3ab7e02cb59115e10343da03f18951 (diff) |
Merge pull request #940 from WilliButz/fix-configurable-paths
enhance configurabiltiy of paths & make execution path-independent
Diffstat (limited to 'lib/web')
-rw-r--r-- | lib/web/imageRouter/filesystem.js | 3 | ||||
-rw-r--r-- | lib/web/statusRouter.js | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/web/imageRouter/filesystem.js b/lib/web/imageRouter/filesystem.js index 4bf82b31..8c432b0c 100644 --- a/lib/web/imageRouter/filesystem.js +++ b/lib/web/imageRouter/filesystem.js @@ -1,5 +1,6 @@ 'use strict' const url = require('url') +const path = require('path') const config = require('../../config') const logger = require('../../logger') @@ -15,5 +16,5 @@ exports.uploadImage = function (imagePath, callback) { return } - callback(null, url.resolve(config.serverURL + '/', imagePath.match(/public\/(.+)$/)[1])) + callback(null, url.resolve(config.serverURL + '/uploads/', path.basename(imagePath))) } diff --git a/lib/web/statusRouter.js b/lib/web/statusRouter.js index 7ecf3839..fb2609ea 100644 --- a/lib/web/statusRouter.js +++ b/lib/web/statusRouter.js @@ -105,5 +105,5 @@ statusRouter.get('/config', function (req, res) { 'X-Robots-Tag': 'noindex, nofollow', // prevent crawling 'Content-Type': 'application/javascript' }) - res.render(config.constantsPath, data) + res.render('../js/lib/common/constant.ejs', data) }) |