From 830bcd0f82c16b8b5f1259150a6d541a210693eb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 11 Nov 2016 10:55:07 +0100 Subject: Prerender opengraph tags in the server --- server.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'server.js') 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({ // 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 ----------- -- cgit v1.2.3