Skip to content

Commit 431c4a9

Browse files
committed
Revert "changed cors"
This reverts commit 5b2a0b3.
1 parent 4cce1d9 commit 431c4a9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

backend/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const port = process.env.BACKEND_PORT || 3001;
1212
const { SESSION_KEY, url, FRONTEND_URL } = require("./settings/env.js");
1313
app.use(
1414
cors({
15-
origin: FRONTEND_URL,
15+
origin:
16+
process.env.NODE_ENV === "production"
17+
? FRONTEND_URL
18+
: "http://localhost:3000",
1619
credentials: true,
1720
}),
1821
);
@@ -74,6 +77,6 @@ app.get("*", function (req, res) {
7477
app.listen(port, function (req, res) {
7578
console.log(
7679
"server is running on Production:-",
77-
process.env.NODE_ENV == "production" ? "true" : "false",
80+
process.env.NODE_ENV == "production" ? "false" : "true",
7881
);
7982
});

0 commit comments

Comments
 (0)