Merge pull request #855 from hackmdio/fix/constants

Move config out of statics path
This commit is contained in:
Christoph (Sheogorath) Kern 2018-06-24 01:58:08 +02:00 committed by GitHub
commit b8726bbe8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 17 deletions

View file

@ -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)
})