2025-10-28 11:45:51 -03:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
|
|
2025-10-29 15:50:55 -03:00
|
|
|
// https://vitejs.dev/config/
|
2025-10-28 11:45:51 -03:00
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
2025-10-29 15:50:55 -03:00
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
// Redirige cualquier petición que empiece con '/api' al backend
|
|
|
|
|
'/api': {
|
|
|
|
|
target: 'http://localhost:5174', // <-- Usa el puerto HTTP del backend
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
// Redirige cualquier petición a '/titularesHub' al backend (para SignalR)
|
|
|
|
|
'/titularesHub': {
|
|
|
|
|
target: 'http://localhost:5174', // <-- Usa el mismo puerto
|
|
|
|
|
ws: true, // <-- Habilita el proxy para WebSockets (crucial para SignalR)
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|