From b66a6aa7b7c05ed1fb3ba2d1dabbfd2abd1364d5 Mon Sep 17 00:00:00 2001
From: Christian Paul <christianp@matrix.org>
Date: Wed, 2 Dec 2020 15:56:09 +0100
Subject: [PATCH] Add /health HTTP endpoint

---
 src/discordas.ts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/discordas.ts b/src/discordas.ts
index 190575d..e4b6617 100644
--- a/src/discordas.ts
+++ b/src/discordas.ts
@@ -176,6 +176,11 @@ async function run() {
     const roomhandler = discordbot.RoomHandler;
     const eventProcessor = discordbot.MxEventProcessor;
 
+    // tslint:disable-next-line:no-any
+    appservice.expressAppInstance.get("/health", (_, res: any) => {
+        res.status(201).send("");
+    });
+
     // tslint:disable-next-line:no-any
     appservice.on("query.room", async (roomAlias: string, createRoom: (opts: any) => Promise<void>) => {
         try {
-- 
GitLab