aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-11 10:55:07 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commit830bcd0f82c16b8b5f1259150a6d541a210693eb (patch)
tree0c53767ad759cb6891be7fdc3a79631e176fc68a /server.js
parentad4013d5c3b0e67c453f10962a5b1e3c9b563b74 (diff)
downloadPeerTube-830bcd0f82c16b8b5f1259150a6d541a210693eb.tar.gz
PeerTube-830bcd0f82c16b8b5f1259150a6d541a210693eb.tar.zst
PeerTube-830bcd0f82c16b8b5f1259150a6d541a210693eb.zip
Prerender opengraph tags in the server
Diffstat (limited to 'server.js')
-rw-r--r--server.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/server.js b/server.js
index 65cf69f7d..d3d3661ad 100644
--- a/server.js
+++ b/server.js
@@ -69,6 +69,7 @@ app.use(expressValidator({
69// API routes 69// API routes
70const apiRoute = '/api/' + constants.API_VERSION 70const apiRoute = '/api/' + constants.API_VERSION
71app.use(apiRoute, routes.api) 71app.use(apiRoute, routes.api)
72app.use('/', routes.client)
72 73
73// Static files 74// Static files
74app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE })) 75app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE }))
@@ -88,12 +89,9 @@ app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPat
88const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR 89const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR
89app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) 90app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
90 91
91// Client application 92// Always serve index client page
92app.use('/videos/embed', function (req, res, next) {
93 res.sendFile(path.join(__dirname, 'client/dist/standalone/videos/embed.html'))
94})
95app.use('/*', function (req, res, next) { 93app.use('/*', function (req, res, next) {
96 res.sendFile(path.join(__dirname, 'client/dist/index.html')) 94 res.sendFile(path.join(__dirname, './client/dist/index.html'))
97}) 95})
98 96
99// ----------- Tracker ----------- 97// ----------- Tracker -----------