mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-17 12:32:19 +00:00
Fix broken assets
Since switching to TypeScript our assets are broken due to the move of app.js to the `./lib` subdirectory and the relative patch specified for the public directory. This patch solves the problem by adding a proper config element for the path and referencing it in `./lib/app.js`. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
004e2fbcb2
commit
95355b8f01
3 changed files with 3 additions and 1 deletions
|
@ -126,7 +126,7 @@ app.use(i18n.init)
|
|||
|
||||
// routes without sessions
|
||||
// static files
|
||||
app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime, index: false, redirect: false }))
|
||||
app.use('/', express.static(path.resolve(__dirname, config.publicPath), { maxAge: config.staticCacheTime, index: false, redirect: false }))
|
||||
app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { maxAge: config.staticCacheTime, redirect: false }))
|
||||
app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { maxAge: config.staticCacheTime, redirect: false }))
|
||||
app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), { maxAge: config.staticCacheTime }))
|
||||
|
|
|
@ -42,6 +42,7 @@ module.exports = {
|
|||
sslCAPath: '',
|
||||
dhParamPath: '',
|
||||
// other path
|
||||
publicPath: './public',
|
||||
viewPath: './public/views',
|
||||
tmpPath: os.tmpdir(),
|
||||
defaultNotePath: './public/default.md',
|
||||
|
|
|
@ -205,6 +205,7 @@ config.sslKeyPath = path.resolve(appRootPath, config.sslKeyPath)
|
|||
config.dhParamPath = path.resolve(appRootPath, config.dhParamPath)
|
||||
config.viewPath = path.resolve(appRootPath, config.viewPath)
|
||||
config.tmpPath = path.resolve(appRootPath, config.tmpPath)
|
||||
config.publicPath = path.resolve(appRootPath, config.publicPath)
|
||||
config.defaultNotePath = path.resolve(appRootPath, config.defaultNotePath)
|
||||
config.docsPath = path.resolve(appRootPath, config.docsPath)
|
||||
config.uploadsPath = path.resolve(appRootPath, config.uploadsPath)
|
||||
|
|
Loading…
Reference in a new issue