diff options
-rw-r--r-- | server.js | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -17,7 +17,6 @@ process.title = 'peertube' | |||
17 | const app = express() | 17 | const app = express() |
18 | 18 | ||
19 | // ----------- Database ----------- | 19 | // ----------- Database ----------- |
20 | const config = require('config') | ||
21 | const constants = require('./server/initializers/constants') | 20 | const constants = require('./server/initializers/constants') |
22 | const database = require('./server/initializers/database') | 21 | const database = require('./server/initializers/database') |
23 | const logger = require('./server/helpers/logger') | 22 | const 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 | ||
76 | const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) | 75 | const torrentsPhysicalPath = path.join(__dirname, constants.CONFIG.STORAGE.TORRENTS_DIR) |
77 | app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) | 76 | app.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 |
80 | const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) | 79 | const videosPhysicalPath = path.join(__dirname, constants.CONFIG.STORAGE.VIDEOS_DIR) |
81 | app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) | 80 | app.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 |
84 | const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) | 83 | const thumbnailsPhysicalPath = path.join(__dirname, constants.CONFIG.STORAGE.THUMBNAILS_DIR) |
85 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) | 84 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) |
86 | 85 | ||
87 | // Client application | 86 | // Client application |