diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-11 10:55:07 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-16 20:29:26 +0100 |
commit | 830bcd0f82c16b8b5f1259150a6d541a210693eb (patch) | |
tree | 0c53767ad759cb6891be7fdc3a79631e176fc68a /server.js | |
parent | ad4013d5c3b0e67c453f10962a5b1e3c9b563b74 (diff) | |
download | PeerTube-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.js | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -69,6 +69,7 @@ app.use(expressValidator({ | |||
69 | // API routes | 69 | // API routes |
70 | const apiRoute = '/api/' + constants.API_VERSION | 70 | const apiRoute = '/api/' + constants.API_VERSION |
71 | app.use(apiRoute, routes.api) | 71 | app.use(apiRoute, routes.api) |
72 | app.use('/', routes.client) | ||
72 | 73 | ||
73 | // Static files | 74 | // Static files |
74 | app.use('/client', express.static(path.join(__dirname, '/client/dist'), { maxAge: constants.STATIC_MAX_AGE })) | 75 | 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 | |||
88 | const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR | 89 | const thumbnailsPhysicalPath = constants.CONFIG.STORAGE.THUMBNAILS_DIR |
89 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) | 90 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: constants.STATIC_MAX_AGE })) |
90 | 91 | ||
91 | // Client application | 92 | // Always serve index client page |
92 | app.use('/videos/embed', function (req, res, next) { | ||
93 | res.sendFile(path.join(__dirname, 'client/dist/standalone/videos/embed.html')) | ||
94 | }) | ||
95 | app.use('/*', function (req, res, next) { | 93 | app.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 ----------- |