aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/server.js b/server.js
index b29fba633..e5bb5d1a4 100644
--- a/server.js
+++ b/server.js
@@ -17,7 +17,6 @@ process.title = 'peertube'
17const app = express() 17const app = express()
18 18
19// ----------- Database ----------- 19// ----------- Database -----------
20const config = require('config')
21const constants = require('./server/initializers/constants') 20const constants = require('./server/initializers/constants')
22const database = require('./server/initializers/database') 21const database = require('./server/initializers/database')
23const logger = require('./server/helpers/logger') 22const logger = require('./server/helpers/logger')
@@ -73,15 +72,15 @@ app.use('/client/*', function (req, res, next) {
73 res.sendStatus(404) 72 res.sendStatus(404)
74}) 73})
75 74
76const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) 75const torrentsPhysicalPath = path.join(__dirname, constants.CONFIG.STORAGE.TORRENTS_DIR)
77app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) 76app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
78 77
79// Videos path for webseeding 78// Videos path for webseeding
80const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) 79const videosPhysicalPath = path.join(__dirname, constants.CONFIG.STORAGE.VIDEOS_DIR)
81app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) 80app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
82 81
83// Thumbnails path for express 82// Thumbnails path for express
84const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) 83const thumbnailsPhysicalPath = path.join(__dirname, constants.CONFIG.STORAGE.THUMBNAILS_DIR)
85app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) 84app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
86 85
87// Client application 86// Client application