diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 12:28:32 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 13:13:49 +0200 |
commit | dc0091326156aaeda566151b65fe8d49097750b9 (patch) | |
tree | 7e2b30d3db3a4c2f7ba65c84c607815396f018bf /server.js | |
parent | c731ee4efdbc3c6e867b024110fc12aac326f543 (diff) | |
download | PeerTube-dc0091326156aaeda566151b65fe8d49097750b9.tar.gz PeerTube-dc0091326156aaeda566151b65fe8d49097750b9.tar.zst PeerTube-dc0091326156aaeda566151b65fe8d49097750b9.zip |
Client: avoid "quit friends" to appear during the pending request
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -68,22 +68,22 @@ const apiRoute = '/api/' + constants.API_VERSION | |||
68 | app.use(apiRoute, routes.api) | 68 | app.use(apiRoute, routes.api) |
69 | 69 | ||
70 | // Static files | 70 | // Static files |
71 | app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: 0 })) | 71 | app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE })) |
72 | // 404 for static files not found | 72 | // 404 for static files not found |
73 | app.use('/client/*', function (req, res, next) { | 73 | app.use('/client/*', function (req, res, next) { |
74 | res.sendStatus(404) | 74 | res.sendStatus(404) |
75 | }) | 75 | }) |
76 | 76 | ||
77 | const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) | 77 | const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) |
78 | app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: '7d' })) | 78 | app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) |
79 | 79 | ||
80 | // Videos path for webseeding | 80 | // Videos path for webseeding |
81 | const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) | 81 | const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) |
82 | app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: '7d' })) | 82 | app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) |
83 | 83 | ||
84 | // Thumbnails path for express | 84 | // Thumbnails path for express |
85 | const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) | 85 | const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) |
86 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: '7d' })) | 86 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) |
87 | 87 | ||
88 | // Client application | 88 | // Client application |
89 | app.use('/*', function (req, res, next) { | 89 | app.use('/*', function (req, res, next) { |