diff --git a/src/main.ts b/src/main.ts index 9da9f87..6327a1f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,12 +1,20 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; +import { Logger } from '@nestjs/common'; async function bootstrap() { const app = await NestFactory.create(AppModule); - app.enableCors({ - credentials: true, - origin: ['https://shows.everest.tailscale/admin/'] - }); + + if (process.env.NODE_ENV == 'production') { + app.enableCors({ + credentials: true, + origin: ['https://shows.everest.tailscale/admin/'], + }); + } else { + const logger = new Logger("bootstrap") + logger.log("In development mode, not enabling CORS") + } + await app.listen(process.env.PORT ?? 3000); } bootstrap();