Skip to content

Commit

Permalink
Merge pull request #74 from atlp-rwanda/fx-cors
Browse files Browse the repository at this point in the history
extended cors for whole application
  • Loading branch information
teerenzo authored May 31, 2024
2 parents e0563b8 + b8993aa commit de00d1b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ app.use(express.urlencoded({ extended: true }));

app.use(
cors({
origin:env.client_url,
origin: (origin, callback) => {
if (!origin || allowedOrigins.includes(origin)) {
callback(null, true);
} else {
callback(new Error("Not allowed by CORS"));
}
},
}),
);

Expand Down

0 comments on commit de00d1b

Please sign in to comment.