admin08077 commited on
Commit
07060d4
·
verified ·
1 Parent(s): 11849e0

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +3 -3
server.js CHANGED
@@ -215,9 +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
- // 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
  }
 
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, wildcard parameters must be named.
219
+ // Using '/:path*' satisfies path-to-regexp v8 requirements for catch-all routing.
220
+ app.get('/:path*', (req, res) => {
221
  if (req.path.startsWith('/api')) {
222
  return res.status(404).json({ error: 'API endpoint not found' });
223
  }