diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-15 22:22:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-20 09:57:40 +0200 |
commit | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (patch) | |
tree | 4f2158c61a9b7c3f47cfa233d01413b946ee53c0 /server/controllers/static.js | |
parent | d5f345ed4cfac4e1fa84dcb4fce1cda4d32f9c73 (diff) | |
download | PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.gz PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.zst PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.zip |
First typescript iteration
Diffstat (limited to 'server/controllers/static.js')
-rw-r--r-- | server/controllers/static.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/server/controllers/static.js b/server/controllers/static.js deleted file mode 100644 index 810b752af..000000000 --- a/server/controllers/static.js +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | const express = require('express') | ||
4 | const cors = require('cors') | ||
5 | |||
6 | const constants = require('../initializers/constants') | ||
7 | |||
8 | const router = express.Router() | ||
9 | |||
10 | /* | ||
11 | Cors is very important to let other pods access torrent and video files | ||
12 | */ | ||
13 | |||
14 | const torrentsPhysicalPath = constants.CONFIG.STORAGE.TORRENTS_DIR | ||
15 | router.use( | ||
16 | constants.STATIC_PATHS.TORRENTS, | ||
17 | cors(), | ||
18 | express.static(torrentsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }) | ||
19 | ) | ||
20 | |||
21 | // Videos path for webseeding | ||
22 | const videosPhysicalPath = constants.CONFIG.STORAGE.VIDEOS_DIR | ||
23 | router.use( | ||
24 | constants.STATIC_PATHS.WEBSEED, | ||
25 | cors(), | ||
26 | express.static(videosPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }) | ||
27 | ) | ||
28 | |||
29 | // Thumbnails path for express | ||
30 | const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR | ||
31 | router.use( | ||
32 | constants.STATIC_PATHS.THUMBNAILS, | ||
33 | express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }) | ||
34 | ) | ||
35 | |||
36 | // Video previews path for express | ||
37 | const previewsPhysicalPath = constants.CONFIG.STORAGE.PREVIEWS_DIR | ||
38 | router.use( | ||
39 | constants.STATIC_PATHS.PREVIEWS, | ||
40 | express.static(previewsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }) | ||
41 | ) | ||
42 | |||
43 | // --------------------------------------------------------------------------- | ||
44 | |||
45 | module.exports = router | ||