From 6e06709e9c7435006ec4114db3ec71191ad578a2 Mon Sep 17 00:00:00 2001 From: Jan Szumotalski Date: Tue, 15 Apr 2025 16:20:48 +0200 Subject: [PATCH] fix: Changed env --- compose.yml | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compose.yml b/compose.yml index 5064e0d..affbaad 100644 --- a/compose.yml +++ b/compose.yml @@ -4,7 +4,7 @@ services: ports: - "12230:8080" environment: - - ORIGIN=CHANGE_ME + - DOMAIN=CHANGE_ME - SECRET=CHANGE_ME depends_on: - mongodb diff --git a/src/index.ts b/src/index.ts index 93e40f6..3eeccee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ import routes from "./routes/index"; import process from "node:process" const connectionString = process.env.ATLAS_URI || "mongodb://mongodb:27017/ipwa"; -if (!process.env.ORIGIN) { +if (!process.env.DOMAIN) { console.log("CORS origin undefined") process.exit(1) } @@ -35,7 +35,7 @@ var app = express(); app.use(bodyParser.json()) app.use(bodyParser.urlencoded({extended: true})) app.use(cors({ - origin: ["http://localhost:4200", "http://localhost:3000", process.env.ORIGIN,], + origin: ["http://localhost:4200", "http://localhost:3000", `htt[s://${process.env.DOMAIN}`,], credentials: true })) app.use(session({