dante commited on
Upload server.js
Browse files
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(
|
| 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' });
|