Fix: Use regex literal for wildcard route to support Express 5
This commit is contained in:
parent
53eb326cbe
commit
d2b253e65d
@ -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