From 3b8a46ed4d0542305e2a222be052a0147be8c712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Wachnicki-W=C4=99grzyn?= Date: Wed, 19 Nov 2025 22:17:47 +0100 Subject: [PATCH] Disable cors, set port though environment variable --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index f1a0fec..17fe2de 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,7 +11,7 @@ async function bootstrap(): Promise { const localDocUrl = '/doc'; const app = await NestFactory.create(AppModule, { cors: { - origin: false, + origin: '*', }, }); app.useGlobalFilters(new HttpExceptionFilter()); @@ -39,7 +39,7 @@ async function bootstrap(): Promise { const document = SwaggerModule.createDocument(app, config); SwaggerModule.setup(localDocUrl, app, document); - await app.listen(3000); + await app.listen(process.env.PORT ?? 3000); console.log(`App is loaded at ${await app.getUrl()}${appURL} URL`); console.log(`See documentation at ${await app.getUrl()}${localDocUrl} URL`); }