fix: Changed env

This commit is contained in:
2025-04-15 16:20:48 +02:00
parent 7f3cefdc22
commit 6e06709e9c
2 changed files with 3 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ services:
ports: ports:
- "12230:8080" - "12230:8080"
environment: environment:
- ORIGIN=CHANGE_ME - DOMAIN=CHANGE_ME
- SECRET=CHANGE_ME - SECRET=CHANGE_ME
depends_on: depends_on:
- mongodb - mongodb

View File

@@ -12,7 +12,7 @@ import routes from "./routes/index";
import process from "node:process" import process from "node:process"
const connectionString = process.env.ATLAS_URI || "mongodb://mongodb:27017/ipwa"; const connectionString = process.env.ATLAS_URI || "mongodb://mongodb:27017/ipwa";
if (!process.env.ORIGIN) { if (!process.env.DOMAIN) {
console.log("CORS origin undefined") console.log("CORS origin undefined")
process.exit(1) process.exit(1)
} }
@@ -35,7 +35,7 @@ var app = express();
app.use(bodyParser.json()) app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended: true})) app.use(bodyParser.urlencoded({extended: true}))
app.use(cors({ 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 credentials: true
})) }))
app.use(session({ app.use(session({