Skip to content

Commit

Permalink
wip: Logging to debug pizza
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Jan 16, 2024
1 parent 67e5157 commit 0abc5a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api.planx.uk/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ const checkAllowedOrigins: CorsOptions["origin"] = (origin, callback) => {
const allowList = process.env.CORS_ALLOWLIST?.split(", ") || [];
const isAllowed = origin && allowList.includes(origin);

console.log("****************");
console.log("****************");
console.log({ allowList });
console.log({ origin });
console.log({ isAllowed });
console.log("****************");
console.log("****************");

isTest || isDevelopment || isAllowed
? callback(null, true)
: callback(new Error("Not allowed by CORS"));
Expand Down

0 comments on commit 0abc5a9

Please sign in to comment.