diff --git a/src/main.ts b/src/main.ts index 35872dd..d6d0d19 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,6 +27,12 @@ async function bootstrap() { const app = await NestFactory.create(AppModule); + // CORS para la web (Flutter web corre en otro origen — p.ej. localhost — + // y sin esto el navegador bloquea todos los fetch y la app muestra + // "Sin conexión con el servidor"). Mismo criterio que el gateway socket.io + // (origin '*'): la API ya se protege con JWT, no con CORS. + app.enableCors(); + // Seed del primer Developer (idempotente) — requiere tablas ya sincronizadas por TypeORM try { await seedFirstDeveloper();