fix: nginx proxy URI, SW cache, sw.js no-cache

This commit is contained in:
Claude
2026-05-01 07:53:54 +02:00
parent 50758fe232
commit 6af62b401c
2 changed files with 19 additions and 2 deletions
+15 -1
View File
@@ -124,4 +124,18 @@ if (fs.existsSync(frontendPath)) {
});
app.use(express.static(frontendPath));
// SPA fallback - toutes les routes non-API ser
// SPA fallback - toutes les routes non-API servent index.html
app.get('*', (req, res) => {
if (!req.path.startsWith('/api')) {
res.sendFile(path.join(frontendPath, 'index.html'));
}
});
}
// ─── Démarrage ───────────────────────────────────────────────────────────────
app.listen(PORT, () => {
console.log(`🚀 EquiTask API démarrée sur le port ${PORT}`);
console.log(` Mode : ${process.env.NODE_ENV || 'development'}`);
});
export default app;
+4 -1
View File
@@ -46,4 +46,7 @@ export default defineConfig({
server: {
port: 5173,
proxy: {
'/api': { target: 'http://localhost
'/api': { target: 'http://localhost:3001', changeOrigin: true },
},
},
});