Skip to content

Commit

Permalink
fix cors
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdan committed Mar 27, 2023
1 parent 138ac60 commit c3e52b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion back/src/core/servers/express.server.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import express from 'express';
import bodyParser from 'body-parser';
import { corsOptions } from './cors';
import { envConstants } from 'core/constants';

export const createApp = () => {
const app = express();

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(corsOptions);
if (envConstants.CORS_ORIGIN !== 'false') {
app.use(corsOptions);
}

return app;
};

0 comments on commit c3e52b8

Please sign in to comment.