Fix: Express 5 requirement for named parameters in catch-all route
Browse files- backend/server.js +1 -1
backend/server.js
CHANGED
|
@@ -134,7 +134,7 @@ app.get('/manifesto', (req, res) => res.sendFile(path.join(__dirname, 'public',
|
|
| 134 |
app.get('/broadcast', (req, res) => res.sendFile(path.join(__dirname, 'public', 'broadcast.html')));
|
| 135 |
|
| 136 |
// Catch-all for React/Frontend routes should come AFTER specific API/Static routes
|
| 137 |
-
app.get('
|
| 138 |
if (req.path.startsWith('/api')) return next();
|
| 139 |
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
| 140 |
});
|
|
|
|
| 134 |
app.get('/broadcast', (req, res) => res.sendFile(path.join(__dirname, 'public', 'broadcast.html')));
|
| 135 |
|
| 136 |
// Catch-all for React/Frontend routes should come AFTER specific API/Static routes
|
| 137 |
+
app.get('/:path*', (req, res, next) => {
|
| 138 |
if (req.path.startsWith('/api')) return next();
|
| 139 |
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
| 140 |
});
|