Skip to content

Commit

Permalink
Update cors so localhost can use the api (#55)
Browse files Browse the repository at this point in the history
* update cors to run on all localhost

* update syntax for regex

* Allow only localhost 3000
  • Loading branch information
Kang-Quan authored Oct 19, 2023
1 parent e919fb9 commit 6eb7cb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/profile-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const app = express();
// Before the end of this project, allows CORS for localhost too
const corsOptions = {
origin: (origin, callback) => {
const allowedOrigins = [
const allowedOrigins = [
"https://app.peerprepgroup51sem1y2023.xyz",
"http://localhost"
];
"http://localhost:3000",
];
if (!origin || allowedOrigins.includes(origin)) {
callback(null, true);
} else {
Expand Down

0 comments on commit 6eb7cb7

Please sign in to comment.