diff options
Diffstat (limited to 'lib/web')
-rw-r--r-- | lib/web/imageRouter/filesystem.js | 2 | ||||
-rw-r--r-- | lib/web/statusRouter.js | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/web/imageRouter/filesystem.js b/lib/web/imageRouter/filesystem.js index 145876a9..4bf82b31 100644 --- a/lib/web/imageRouter/filesystem.js +++ b/lib/web/imageRouter/filesystem.js @@ -15,5 +15,5 @@ exports.uploadImage = function (imagePath, callback) { return } - callback(null, url.resolve(config.serverURL + '/', imagePath.match(/^public\/(.+$)/)[1])) + callback(null, url.resolve(config.serverURL + '/', imagePath.match(/public\/(.+)$/)[1])) } diff --git a/lib/web/statusRouter.js b/lib/web/statusRouter.js index d22fac47..4495a28e 100644 --- a/lib/web/statusRouter.js +++ b/lib/web/statusRouter.js @@ -90,3 +90,20 @@ statusRouter.post('/temp', urlencodedParser, function (req, res) { } } }) + +statusRouter.get('/config', function (req, res) { + var data = { + domain: config.domain, + urlpath: config.urlPath, + debug: config.debug, + version: config.version, + DROPBOX_APP_KEY: config.dropbox.appKey, + allowedUploadMimeTypes: config.allowedUploadMimeTypes + } + res.set({ + 'Cache-Control': 'private', // only cache by client + 'X-Robots-Tag': 'noindex, nofollow', // prevent crawling + 'HackMD-Version': config.version + }) + res.render(config.constantsPath, data) +}) |