fix: Changed env
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user