1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Prerender opengraph tags in the server

This commit is contained in:
Chocobozzz 2016-11-11 10:55:07 +01:00
parent ad4013d5c3
commit 830bcd0f82
4 changed files with 95 additions and 6 deletions

View file

@ -69,6 +69,7 @@ app.use(expressValidator({
// API routes
const apiRoute = '/api/' + constants.API_VERSION
app.use(apiRoute, routes.api)
app.use('/', routes.client)
// Static files
app.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
const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR
app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE }))
// Client application
app.use('/videos/embed', function (req, res, next) {
res.sendFile(path.join(__dirname, 'client/dist/standalone/videos/embed.html'))
})
// Always serve index client page
app.use('/*', function (req, res, next) {
res.sendFile(path.join(__dirname, 'client/dist/index.html'))
res.sendFile(path.join(__dirname, './client/dist/index.html'))
})
// ----------- Tracker -----------