aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/server.js b/server.js
index 5feb21476..e90ed5c25 100644
--- a/server.js
+++ b/server.js
@@ -2,6 +2,7 @@
2 2
3// ----------- Node modules ----------- 3// ----------- Node modules -----------
4const bodyParser = require('body-parser') 4const bodyParser = require('body-parser')
5const cors = require('cors')
5const express = require('express') 6const express = require('express')
6const expressValidator = require('express-validator') 7const expressValidator = require('express-validator')
7const http = require('http') 8const http = require('http')
@@ -74,11 +75,11 @@ app.use('/client/*', function (req, res, next) {
74}) 75})
75 76
76const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) 77const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents'))
77app.use(constants.STATIC_PATHS.TORRENTS, express.static(torrentsPhysicalPath, { maxAge: 0 })) 78app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: 0 }))
78 79
79// Uploads path for webseeding 80// Uploads path for webseeding
80const uploadsPhysicalPath = path.join(__dirname, config.get('storage.uploads')) 81const uploadsPhysicalPath = path.join(__dirname, config.get('storage.uploads'))
81app.use(constants.STATIC_PATHS.WEBSEED, express.static(uploadsPhysicalPath, { maxAge: 0 })) 82app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(uploadsPhysicalPath, { maxAge: 0 }))
82 83
83// Thumbnails path for express 84// Thumbnails path for express
84const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) 85const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails'))