Skip to content

Commit 5b2a0b3

Browse files
committed
changed cors
1 parent 69167de commit 5b2a0b3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

backend/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ 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:
16-
process.env.NODE_ENV === "production"
17-
? FRONTEND_URL
18-
: "http://localhost:3000",
15+
origin: FRONTEND_URL,
1916
credentials: true,
2017
}),
2118
);
@@ -77,6 +74,6 @@ app.get("*", function (req, res) {
7774
app.listen(port, function (req, res) {
7875
console.log(
7976
"server is running on Production:-",
80-
process.env.NODE_ENV == "production" ? "false" : "true",
77+
process.env.NODE_ENV == "production" ? "true" : "false",
8178
);
8279
});

0 commit comments

Comments
 (0)