mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -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
16
app.js
16
app.js
|
@ -26,22 +26,6 @@ var response = require('./lib/response')
|
|||
var models = require('./lib/models')
|
||||
var csp = require('./lib/csp')
|
||||
|
||||
// generate front-end constants by template
|
||||
var constpath = path.join(__dirname, './public/js/lib/common/constant.ejs')
|
||||
var data = {
|
||||
domain: config.domain,
|
||||
urlpath: config.urlPath,
|
||||
debug: config.debug,
|
||||
version: config.version,
|
||||
DROPBOX_APP_KEY: config.dropbox.appKey,
|
||||
allowedUploadMimeTypes: config.allowedUploadMimeTypes
|
||||
}
|
||||
|
||||
ejs.renderFile(constpath, data, {}, function (err, str) {
|
||||
if (err) throw new Error(err)
|
||||
fs.writeFileSync(path.join(__dirname, './public/build/constant.js'), str)
|
||||
})
|
||||
|
||||
// server setup
|
||||
var app = express()
|
||||
var server = null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue