Merge pull request #940 from WilliButz/fix-configurable-paths

enhance configurabiltiy of paths & make execution path-independent
This commit is contained in:
Christoph (Sheogorath) Kern 2018-10-05 22:21:01 +02:00 committed by GitHub
commit 32af96aa37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 45 deletions

View file

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