aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/server.js b/server.js
index d3d3661ad..16e27e852 100644
--- a/server.js
+++ b/server.js
@@ -71,7 +71,8 @@ const apiRoute = '/api/' + constants.API_VERSION
71app.use(apiRoute, routes.api) 71app.use(apiRoute, routes.api)
72app.use('/', routes.client) 72app.use('/', routes.client)
73 73
74// Static files 74// Static client files
75// TODO: move in client
75app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE })) 76app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE }))
76// 404 for static files not found 77// 404 for static files not found
77app.use('/client/*', function (req, res, next) { 78app.use('/client/*', function (req, res, next) {
@@ -89,6 +90,10 @@ app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPat
89const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR 90const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR
90app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) 91app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
91 92
93// Video previews path for express
94const previewsPhysicalPath = constants.CONFIG.STORAGE.PREVIEWS_DIR
95app.use(constants.STATIC_PATHS.PREVIEWS, express.static(previewsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
96
92// Always serve index client page 97// Always serve index client page
93app.use('/*', function (req, res, next) { 98app.use('/*', function (req, res, next) {
94 res.sendFile(path.join(__dirname, './client/dist/index.html')) 99 res.sendFile(path.join(__dirname, './client/dist/index.html'))