summaryrefslogtreecommitdiff
path: root/lib/web
diff options
context:
space:
mode:
authorSheogorath2018-06-24 00:06:03 +0200
committerSheogorath2018-06-24 00:07:32 +0200
commit0ed4b50098b4329b1d91e519bbbbe4e14701f92f (patch)
tree109e0d0cf888b547bed00c946228810dcf5e9d4a /lib/web
parent7c7cc289f2c2b2e33a32ea32a6e97ea1410cc63e (diff)
Move config out of statics path
Since static path is providing with a high expiration data, we provide configs via API. This shouldn't add any noticeable load while making it uncached and this way working again. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to '')
-rw-r--r--lib/web/statusRouter.js17
1 files changed, 17 insertions, 0 deletions
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)
+})