diff options
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 ----------- |