Spaces:
Sleeping
Sleeping
fixed server file
Browse files
server.js
CHANGED
|
@@ -198,8 +198,8 @@ app.post('/api/modify-code', async (req, res) => {
|
|
| 198 |
}
|
| 199 |
});
|
| 200 |
|
| 201 |
-
// Serve React app for all other routes
|
| 202 |
-
app.get(
|
| 203 |
res.sendFile(path.join(__dirname, 'dist', 'index.html'));
|
| 204 |
});
|
| 205 |
|
|
|
|
| 198 |
}
|
| 199 |
});
|
| 200 |
|
| 201 |
+
// Serve React app for all other routes (use RegExp to avoid path-to-regexp wildcard parsing issues)
|
| 202 |
+
app.get(/.*/, (req, res) => {
|
| 203 |
res.sendFile(path.join(__dirname, 'dist', 'index.html'));
|
| 204 |
});
|
| 205 |
|