Skip to content

Commit

Permalink
feat: use cors only in dev NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed May 9, 2023
1 parent 9d7ec94 commit c19d8b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ require("dotenv");

app.use(compress());
app.use(cookieParser());
app.use(cors());

if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "dev") {
app.use(cors());
}

//#region body parser

Expand Down

0 comments on commit c19d8b0

Please sign in to comment.