aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/server.js b/server.js
index f24b25f4d..d540c301b 100644
--- a/server.js
+++ b/server.js
@@ -68,22 +68,22 @@ const apiRoute = '/api/' + constants.API_VERSION
68app.use(apiRoute, routes.api) 68app.use(apiRoute, routes.api)
69 69
70// Static files 70// Static files
71app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: 0 })) 71app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE }))
72// 404 for static files not found 72// 404 for static files not found
73app.use('/client/*', function (req, res, next) { 73app.use('/client/*', function (req, res, next) {
74 res.sendStatus(404) 74 res.sendStatus(404)
75}) 75})
76 76
77const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) 77const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents'))
78app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: '7d' })) 78app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
79 79
80// Videos path for webseeding 80// Videos path for webseeding
81const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) 81const videosPhysicalPath = path.join(__dirname, config.get('storage.videos'))
82app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: '7d' })) 82app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
83 83
84// Thumbnails path for express 84// Thumbnails path for express
85const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) 85const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails'))
86app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: '7d' })) 86app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
87 87
88// Client application 88// Client application
89app.use('/*', function (req, res, next) { 89app.use('/*', function (req, res, next) {