CrispStrobe commited on
Commit
9b00e3a
·
1 Parent(s): 7c4298c

fix: use idiomatic Express 5 optional wildcard syntax for SPA catch-all

Browse files
Files changed (1) hide show
  1. server.js +1 -1
server.js CHANGED
@@ -241,7 +241,7 @@ app.post('/api/fetch', async (req, res) => {
241
 
242
  // SPA catch-all: serve index.html for any non-API route
243
  if (fs.existsSync(distDir)) {
244
- app.get(/.*/, (req, res) => {
245
  res.sendFile(path.join(distDir, 'index.html'));
246
  });
247
  }
 
241
 
242
  // SPA catch-all: serve index.html for any non-API route
243
  if (fs.existsSync(distDir)) {
244
+ app.get('{/*any}', (req, res) => {
245
  res.sendFile(path.join(distDir, 'index.html'));
246
  });
247
  }