zhlajiex commited on
Commit
64eb025
·
1 Parent(s): c9b7ee1

Fix: Express 5 requirement for named parameters in catch-all route

Browse files
Files changed (1) hide show
  1. 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('(.*)', (req, res, next) => {
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
  });