1 import * as express from 'express'
2 import * as cors from 'cors'
8 } from '../initializers'
10 const staticRouter = express.Router()
13 Cors is very important to let other pods access torrent and video files
16 const torrentsPhysicalPath = CONFIG.STORAGE.TORRENTS_DIR
18 STATIC_PATHS.TORRENTS,
20 express.static(torrentsPhysicalPath, { maxAge: STATIC_MAX_AGE })
23 // Videos path for webseeding
24 const videosPhysicalPath = CONFIG.STORAGE.VIDEOS_DIR
28 express.static(videosPhysicalPath, { maxAge: STATIC_MAX_AGE })
31 // Thumbnails path for express
32 const thumbnailsPhysicalPath = CONFIG.STORAGE.THUMBNAILS_DIR
34 STATIC_PATHS.THUMBNAILS,
35 express.static(thumbnailsPhysicalPath, { maxAge: STATIC_MAX_AGE })
38 // Video previews path for express
39 const previewsPhysicalPath = CONFIG.STORAGE.PREVIEWS_DIR
41 STATIC_PATHS.PREVIEWS,
42 express.static(previewsPhysicalPath, { maxAge: STATIC_MAX_AGE })
45 // ---------------------------------------------------------------------------