feat: add call checks

This commit is contained in:
2024-12-26 13:06:44 +09:00
parent eb30242fe1
commit abacea4f71
10 changed files with 247 additions and 64 deletions

View File

@ -15,6 +15,7 @@ export class WebServer {
this.app.use(express.static('./public'))
this.app.get('/', this.getMainPage.bind(this))
this.app.get('/check_all', this.runCheck.bind(this))
this.app.use(this.error404)
this.app.listen(this.port, this.showBanner.bind(this))
@ -41,6 +42,12 @@ export class WebServer {
})
}
private runCheck(_: Request, res: Response) {
void this.bpManager.runCheck()
res.redirect('/')
}
private error404 (_: Request, res: Response) {
res.status(404).send({ success: false, message: 'Page not found' })
}