feat: add call checks
This commit is contained in:
@ -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' })
|
||||
}
|
||||
|
Reference in New Issue
Block a user