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 4a2404a commit 4c61e2a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/api/website/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,26 @@ export default class WebsiteServer {
app.use(parser.json())

app.use(`/`, new Index().routing())

this.routes.add(new Auth())
this.routes.add(new Profile())
this.routes.add(new Server())
this.routes.add(new Dashboard())
this.routes.add(new Shop())
this.routes.add(new Admin())
app.use(`/auth`, new Auth().routing())
app.use(`/profile`, new Profile().routing())
app.use(`/servers`, new Server().routing())
app.use(`/dashboard`, new Dashboard().routing())
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.')
}

public initServer() {
this.routes.getAll().forEach((route) => {
app.use(`/${route.prefix}`, route.routing())
})

this.server.listen(2443)
}
}

0 comments on commit 4c61e2a

Please sign in to comment.