Skip to content

Commit

Permalink
Merge pull request #52 from jazicorn/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jazicorn authored Oct 5, 2023
2 parents f5fdfa6 + e553cb2 commit 3ce4a11
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions apps/api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,15 @@ class App {
}));
this.app.use(bodyParser.json());
this.app.use(cookieParser());
this.app.options("*", cors({
this.app.options('*', cors());
this.app.use(cors({
origin: this.corsOptions,
credentials : true,
methods: 'GET,PUT,POST,DELETE,OPTIONS',
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
preflightContinue: false,
optionsSuccessStatus: 204
allowedHeaders: 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
}));
// this.app.use( (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.options("/", (req, res) => {
// res.setHeader("Access-Control-Allow-Origin", "*");
// res.setHeader("Access-Control-Allow-Methods", "PUT, POST, GET, DELETE, OPTIONS");
// res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorizatione");
// res.sendStatus(204);
// });
// this.app.set('trust proxy', 1) // trust first proxy
// this.app.use(session({
// secret: process.env.SECRET_TOKEN,
// saveUninitialized:true,
// cookie: { sameSite: 'strict', secure: false, maxAge: 1000 * 60 * 60 * 24 },
// resave: false
// }));
}

private initAuthControllers(controllers) {
Expand Down

1 comment on commit 3ce4a11

@vercel
Copy link

@vercel vercel bot commented on 3ce4a11 Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

recodecamp-api – ./apps/api

recodecamp-api-git-main-jazicorn.vercel.app
recodecamp-api.vercel.app
recodecamp-api-jazicorn.vercel.app

Please sign in to comment.