mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00
Merge pull request #940 from WilliButz/fix-configurable-paths
enhance configurabiltiy of paths & make execution path-independent
This commit is contained in:
commit
32af96aa37
8 changed files with 39 additions and 45 deletions
|
@ -54,7 +54,7 @@ var response = {
|
|||
}
|
||||
|
||||
function responseError (res, code, detail, msg) {
|
||||
res.status(code).render(config.errorPath, {
|
||||
res.status(code).render('error.ejs', {
|
||||
url: config.serverURL,
|
||||
title: code + ' ' + detail + ' ' + msg,
|
||||
code: code,
|
||||
|
@ -104,11 +104,11 @@ function showIndex (req, res, next) {
|
|||
}).then(function (user) {
|
||||
if (user) {
|
||||
data.deleteToken = user.deleteToken
|
||||
res.render(config.indexPath, data)
|
||||
res.render('index.ejs', data)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
res.render(config.indexPath, data)
|
||||
res.render('index.ejs', data)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ function responseCodiMD (res, note) {
|
|||
'Cache-Control': 'private', // only cache by client
|
||||
'X-Robots-Tag': 'noindex, nofollow' // prevent crawling
|
||||
})
|
||||
res.render(config.codimdPath, {
|
||||
res.render('codimd.ejs', {
|
||||
url: config.serverURL,
|
||||
title: title,
|
||||
useCDN: config.useCDN,
|
||||
|
@ -283,7 +283,7 @@ function renderPublish (data, res) {
|
|||
res.set({
|
||||
'Cache-Control': 'private' // only cache by client
|
||||
})
|
||||
res.render(config.prettyPath, data)
|
||||
res.render('pretty.ejs', data)
|
||||
}
|
||||
|
||||
function actionPublish (req, res, note) {
|
||||
|
@ -665,7 +665,7 @@ function renderPublishSlide (data, res) {
|
|||
res.set({
|
||||
'Cache-Control': 'private' // only cache by client
|
||||
})
|
||||
res.render(config.slidePath, data)
|
||||
res.render('slide.ejs', data)
|
||||
}
|
||||
|
||||
module.exports = response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue