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({