mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
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>
This commit is contained in:
parent
7c7cc289f2
commit
0ed4b50098
5 changed files with 20 additions and 17 deletions
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue