admin08077 commited on
Commit
11849e0
·
verified ·
1 Parent(s): 8cc7118

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +3 -1
server.js CHANGED
@@ -215,7 +215,9 @@ app.get(`${CITI_BASE}/accounts/:accountId/transactions`, (req, res) => {
215
  app.use(express.static(path.join(__dirname, 'dist')));
216
 
217
  // SPA Fallback: Redirect all non-API requests to index.html
218
- app.get('*', (req, res) => {
 
 
219
  if (req.path.startsWith('/api')) {
220
  return res.status(404).json({ error: 'API endpoint not found' });
221
  }
 
215
  app.use(express.static(path.join(__dirname, 'dist')));
216
 
217
  // SPA Fallback: Redirect all non-API requests to index.html
218
+ // In Express 5, the unnamed wildcard '*' is no longer supported.
219
+ // Using '/*' ensures all sub-routes are captured for the frontend router.
220
+ app.get('/*', (req, res) => {
221
  if (req.path.startsWith('/api')) {
222
  return res.status(404).json({ error: 'API endpoint not found' });
223
  }