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:
parent
ad4013d5c3
commit
830bcd0f82
4 changed files with 95 additions and 6 deletions
|
@ -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 -----------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue