Fix Express 5 wildcard routing in SPA fallback

This commit is contained in:
airent106 committed 2026-10-13 00:59:11 -06:00
1 parent 7f4fed3c8c
commit 0c98b1babf
1 file changed
+1 -1
+1 -1
View File
@@ -199,7 +199,7 @@ if (fs.existsSync(distPath)) {
app.use(express.static(distPath));
// SPA Fallback: serve index.html for unknown routes
app.get('*', (req, res) => {
app.use((req, res) => {
if (req.path.startsWith('/api') || req.path.startsWith('/uploads')) {
return res.status(404).json({ error: 'Not found' });
}