mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -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
5
app.js
5
app.js
|
@ -126,6 +126,9 @@ app.use(i18n.init)
|
|||
// routes without sessions
|
||||
// static files
|
||||
app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime }))
|
||||
app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { maxAge: config.staticCacheTime }))
|
||||
app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { maxAge: config.staticCacheTime }))
|
||||
app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), { maxAge: config.staticCacheTime }))
|
||||
|
||||
// session
|
||||
app.use(session({
|
||||
|
@ -167,7 +170,7 @@ app.use(require('./lib/web/middleware/codiMDVersion'))
|
|||
|
||||
// routes need sessions
|
||||
// template files
|
||||
app.set('views', path.join(__dirname, '/public/views'))
|
||||
app.set('views', config.viewPath)
|
||||
// set render engine
|
||||
app.engine('ejs', ejs.renderFile)
|
||||
// set view engine
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue