mirror of
https://github.com/zoriya/flood.git
synced 2025-12-06 07:16:18 +00:00
server: Takes baseURI into account for routes and assets
Bug: Flood-UI/flood#849 Cherry-Pick: Flood-UI/flood#866 Signed-off-by: Jesse Chan <jc@linux.com>
This commit is contained in:
committed by
Jesse Chan
parent
5c4a22f0fd
commit
fee968525b
@@ -34,11 +34,11 @@ app.use(cookieParser());
|
||||
|
||||
require('./config/passport')(passport);
|
||||
|
||||
app.use('/api', apiRoutes);
|
||||
app.use('/auth', authRoutes);
|
||||
app.use(path.join(paths.servedPath, 'api'), apiRoutes);
|
||||
app.use(path.join(paths.servedPath, 'auth'), authRoutes);
|
||||
|
||||
// After routes, look for static assets.
|
||||
app.use(express.static(paths.appBuild));
|
||||
app.use(paths.servedPath, express.static(paths.appBuild));
|
||||
// After static assets, always return index.html
|
||||
app.use((req, res) => res.sendFile(path.join(paths.appBuild, 'index.html')));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user