From 58390a577c591dca2ed029c9a41103c8daff1dbd Mon Sep 17 00:00:00 2001 From: Kurbanov Bulat Date: Sun, 2 Jan 2022 14:59:24 +0300 Subject: [PATCH] Add healthcheck endpoint --- src/bots/manager.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bots/manager.ts b/src/bots/manager.ts index 3947af7..ffaeacd 100644 --- a/src/bots/manager.ts +++ b/src/bots/manager.ts @@ -97,7 +97,13 @@ export default class BotsManager { static async launch() { const application = express(); + + application.get("/healthcheck", (req, res) => { + res.send("Ok!"); + }); + application.use((req: Request, res: Response, next: NextFunction) => this.handleUpdate(req, res, next)); + this.server = application.listen(env.WEBHOOK_PORT); console.log("Server started!");