dante commited on
Commit
63f124a
·
verified ·
1 Parent(s): 0db6413

Upload server.js

Browse files
Files changed (1) hide show
  1. server.js +2 -2
server.js CHANGED
@@ -402,8 +402,8 @@ app.post('/api/download/pdf', async (req, res) => {
402
  }
403
  });
404
 
405
- // --- Catch-all to serve index.html for client-side routing ---
406
- app.get('*', (req, res) => {
407
  if (req.path.startsWith('/api')) {
408
  // If it's an API request that wasn't caught above, 404
409
  return res.status(404).json({ error: 'Not Found' });
 
402
  }
403
  });
404
 
405
+ // --- Catch-all to serve index.html for client-side routing (Express 5 fix) ---
406
+ app.get(/.*/, (req, res) => {
407
  if (req.path.startsWith('/api')) {
408
  // If it's an API request that wasn't caught above, 404
409
  return res.status(404).json({ error: 'Not Found' });