routes updated

This commit is contained in:
Lucas Tettamanti
2026-01-18 20:28:27 -03:00
parent 9754347a36
commit b91ece867b
8 changed files with 372 additions and 21 deletions

View File

@@ -31,6 +31,28 @@ export function createApp({ tenantId }) {
res.sendFile(path.join(publicDir, "index.html"));
});
// SPA catch-all - sirve index.html para todas las rutas del frontend
const spaRoutes = [
'/chat', '/conversaciones', '/usuarios', '/productos',
'/equivalencias', '/crosssell', '/cantidades', '/pedidos', '/test'
];
app.get(spaRoutes, (req, res) => {
res.sendFile(path.join(publicDir, "index.html"));
});
// Rutas con parámetros
app.get('/usuarios/:id', (req, res) => {
res.sendFile(path.join(publicDir, "index.html"));
});
app.get('/productos/:id', (req, res) => {
res.sendFile(path.join(publicDir, "index.html"));
});
app.get('/crosssell/:id', (req, res) => {
res.sendFile(path.join(publicDir, "index.html"));
});
app.get('/pedidos/:id', (req, res) => {
res.sendFile(path.join(publicDir, "index.html"));
});
return app;
}