Path: blob/main/components/ws-manager-bridge/src/healthz.ts
2498 views
/**1* Copyright (c) 2024 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import * as express from "express";78export const health = { isHealthy: false };910export function startHealthEndpoint() {11const app = express();12const port = 9090;1314app.get("/healthz", (req, res) => {15if (health.isHealthy) {16res.status(200).send("OK");17} else {18res.status(503).send("Not ready");19}20});2122app.listen(port, () => {23console.log(`Healthz endpoint running on http://localhost:${port}`);24});25}262728