Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider c29cfc72 rédigé par Will Hunt's avatar Will Hunt Validation de GitHub
Parcourir les fichiers

Merge pull request #639 from jaller94/j94/health

Add /health HTTP endpoint
parents 3590fe4f 5351658a
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -26,6 +26,7 @@ import * as usage from "command-line-usage"; ...@@ -26,6 +26,7 @@ import * as usage from "command-line-usage";
import { v4 as uuid } from "uuid"; import { v4 as uuid } from "uuid";
import { IMatrixEvent } from "./matrixtypes"; import { IMatrixEvent } from "./matrixtypes";
import { MetricPeg, PrometheusBridgeMetrics } from "./metrics"; import { MetricPeg, PrometheusBridgeMetrics } from "./metrics";
import { Response } from "express";
const log = new Log("DiscordAS"); const log = new Log("DiscordAS");
...@@ -176,6 +177,15 @@ async function run() { ...@@ -176,6 +177,15 @@ async function run() {
const roomhandler = discordbot.RoomHandler; const roomhandler = discordbot.RoomHandler;
const eventProcessor = discordbot.MxEventProcessor; const eventProcessor = discordbot.MxEventProcessor;
// 2020-12-07: If this fails to build in TypeScript with
// "Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor'.",
// remove @types/express-serve-static-core and @types/serve-static from yarn.lock
// and run yarn.
// See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/49595
appservice.expressAppInstance.get("/health", (_, res: Response) => {
res.status(200).send("");
});
// tslint:disable-next-line:no-any // tslint:disable-next-line:no-any
appservice.on("query.room", async (roomAlias: string, createRoom: (opts: any) => Promise<void>) => { appservice.on("query.room", async (roomAlias: string, createRoom: (opts: any) => Promise<void>) => {
try { try {
......
...@@ -278,9 +278,9 @@ ...@@ -278,9 +278,9 @@
"@types/node" "*" "@types/node" "*"
"@types/express-serve-static-core@*": "@types/express-serve-static-core@*":
version "4.17.13" version "4.17.14"
resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.13.tgz#d9af025e925fc8b089be37423b8d1eac781be084" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.14.tgz#cabf91debeeb3cb04b798e2cff908864e89b6106"
integrity sha512-RgDi5a4nuzam073lRGKTUIaL3eF2+H7LJvJ8eUnCI0wA6SNjXc44DCmWNiTLs/AZ7QlsFWZiw/gTG3nSQGL0fA== integrity sha512-uFTLwu94TfUFMToXNgRZikwPuZdOtDgs3syBtAIr/OXorL1kJqUJT9qCLnRZ5KBOWfZQikQ2xKgR2tnDj1OgDA==
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/qs" "*" "@types/qs" "*"
...@@ -296,6 +296,16 @@ ...@@ -296,6 +296,16 @@
"@types/qs" "*" "@types/qs" "*"
"@types/serve-static" "*" "@types/serve-static" "*"
"@types/express@^4.17.9":
version "4.17.9"
resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.9.tgz#f5f2df6add703ff28428add52bdec8a1091b0a78"
integrity sha512-SDzEIZInC4sivGIFY4Sz1GG6J9UObPwCInYJjko2jzOf/Imx/dlpume6Xxwj1ORL82tBbmN4cPDIDkLbWHk9hw==
dependencies:
"@types/body-parser" "*"
"@types/express-serve-static-core" "*"
"@types/qs" "*"
"@types/serve-static" "*"
"@types/http-cache-semantics@*": "@types/http-cache-semantics@*":
version "4.0.0" version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a"
...@@ -374,9 +384,9 @@ ...@@ -374,9 +384,9 @@
"@types/node" "*" "@types/node" "*"
"@types/serve-static@*": "@types/serve-static@*":
version "1.13.6" version "1.13.8"
resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.6.tgz#866b1b8dec41c36e28c7be40ac725b88be43c5c1" resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.8.tgz#851129d434433c7082148574ffec263d58309c46"
integrity sha512-nuRJmv7jW7VmCVTn+IgYDkkbbDGyIINOeu/G0d74X3lm6E5KfMeQPJhxIt1ayQeQB3cSxvYs1RA/wipYoFB4EA== integrity sha512-MoJhSQreaVoL+/hurAZzIm8wafFR6ajiTM1m4A0kv6AGeVBl4r4pOV8bGFrjjq1sGxDTnCoF8i22o0/aE5XCyA==
dependencies: dependencies:
"@types/mime" "*" "@types/mime" "*"
"@types/node" "*" "@types/node" "*"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter