Fix: Compatibility with Express 5 wildcard routes
This commit is contained in:
parent
afdccb29dc
commit
53eb326cbe
@ -168,7 +168,7 @@ if (fs.existsSync(clientDistPath)) {
|
||||
app.use(express.static(clientDistPath));
|
||||
|
||||
// SPA Fallback: Any route not handled by API should return index.html
|
||||
app.get('*', (req, res) => {
|
||||
app.get('(.*)', (req, res) => {
|
||||
if (!req.path.startsWith('/api')) {
|
||||
res.sendFile(path.join(clientDistPath, 'index.html'));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user