Skip to content

Commit

Permalink
fix cors issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyajones committed Jun 9, 2021
1 parent facf461 commit bacc3b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion release-calendar/src/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ async function main(): Promise<void> {
const app = express();
const port = process.env.PORT;

app.use(function (req, res, next) {
app.use(function (_req, res, next) {
res.header(
'Access-Control-Allow-Origin',
process.env.NODE_ENV === 'production' ?
`${process.env.CLIENT_URL}` :
`${process.env.CLIENT_URL}:${process.env.CLIENT_PORT}`,
);
res.header(
Expand Down

0 comments on commit bacc3b8

Please sign in to comment.