Spaces:
Running
Running
CrispStrobe commited on
Commit ·
9b00e3a
1
Parent(s): 7c4298c
fix: use idiomatic Express 5 optional wildcard syntax for SPA catch-all
Browse files
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(/
|
| 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 |
}
|