Skip to content

Commit

Permalink
update header
Browse files Browse the repository at this point in the history
  • Loading branch information
jazicorn committed Oct 3, 2023
1 parent 557d3ae commit d947775
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ class App {
extended: true
}));
this.app.use(bodyParser.json());
this.app.use(cors({origin:this.corsOptions}));
this.app.use(cookieParser())
this.app.use(cookieParser());
this.app.use(cors({
origin: this.corsOptions
}));
this.app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
next();
});
// this.app.set('trust proxy', 1) // trust first proxy
// this.app.use(session({
// secret: process.env.SECRET_TOKEN,
Expand Down

0 comments on commit d947775

Please sign in to comment.