Skip to content

Commit

Permalink
shop and admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
NebraskyTheWolf committed Jan 27, 2024
1 parent 4c61e2a commit 5ba861b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/api/website/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ export default class WebsiteServer {
cookie: { secure: true }
}))

app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
// @ts-ignore
res.setHeader('Access-Control-Allow-Credentials', true);
next();
});

this.passport.init(app)

// Rotating secret if there is no secret set
Expand All @@ -72,15 +81,6 @@ export default class WebsiteServer {
app.use(`/shop`, new Shop().routing())
app.use(`/admin`, new Admin().routing())

app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
// @ts-ignore
res.setHeader('Access-Control-Allow-Credentials', true);
next();
});

Riniya.instance.logger.info('The website is operational.')
}

Expand Down

0 comments on commit 5ba861b

Please sign in to comment.