Ver Fonte

feat: configure NestJS application with HTTPS and CORS settings in main.ts

Dr-Swopt há 5 dias atrás
pai
commit
fc45571312
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      src/main.ts

+ 2 - 2
src/main.ts

@@ -13,10 +13,10 @@ async function bootstrap() {
   const app = await NestFactory.create(AppModule, { httpsOptions });
 
   app.enableCors({
-    origin: ['https://192.168.100.100:4200', 'https://localhost:4200'],
+    origin: ['https://192.168.100.100:4200', 'https://192.168.100.79:4200', 'https://localhost:4200'],
     credentials: true,
   });
 
-  await app.listen(process.env.PORT ?? 3000);
+  await app.listen(process.env.PORT ?? 3000, process.env.HOST ?? '0.0.0.0');
 }
 bootstrap();