aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-11 11:52:24 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commit6a94a109b4b89a97fe7bfeded3125fb7aad2ac3b (patch)
tree22397531c03da92be50e28703764405002acb926 /server.js
parent830bcd0f82c16b8b5f1259150a6d541a210693eb (diff)
downloadPeerTube-6a94a109b4b89a97fe7bfeded3125fb7aad2ac3b.tar.gz
PeerTube-6a94a109b4b89a97fe7bfeded3125fb7aad2ac3b.tar.zst
PeerTube-6a94a109b4b89a97fe7bfeded3125fb7aad2ac3b.zip
Server: add video preview
Diffstat (limited to 'server.js')
-rw-r--r--server.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/server.js b/server.js
index d3d3661ad..16e27e852 100644
--- a/server.js
+++ b/server.js
@@ -71,7 +71,8 @@ const apiRoute = '/api/' + constants.API_VERSION
71app.use(apiRoute, routes.api) 71app.use(apiRoute, routes.api)
72app.use('/', routes.client) 72app.use('/', routes.client)
73 73
74// Static files 74// Static client files
75// TODO: move in client
75app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE })) 76app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE }))
76// 404 for static files not found 77// 404 for static files not found
77app.use('/client/*', function (req, res, next) { 78app.use('/client/*', function (req, res, next) {
@@ -89,6 +90,10 @@ app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPat
89const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR 90const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR
90app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) 91app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
91 92
93// Video previews path for express
94const previewsPhysicalPath = constants.CONFIG.STORAGE.PREVIEWS_DIR
95app.use(constants.STATIC_PATHS.PREVIEWS, express.static(previewsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
96
92// Always serve index client page 97// Always serve index client page
93app.use('/*', function (req, res, next) { 98app.use('/*', function (req, res, next) {
94 res.sendFile(path.join(__dirname, './client/dist/index.html')) 99 res.sendFile(path.join(__dirname, './client/dist/index.html'))