mirror of
https://github.com/wassname/talk.git
synced 2026-07-23 13:10:20 +08:00
[CORL-388] Health Check (#2336)
* feat: added prelim health-check endpoint * Update health.ts * Update health.ts * fix: lint
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import { RequestHandler } from "express";
|
||||
|
||||
export const healthHandler: RequestHandler = (req, res, next) => {
|
||||
res.status(200).send("OK");
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from "./account";
|
||||
export * from "./auth";
|
||||
export * from "./graphql";
|
||||
export * from "./health";
|
||||
export * from "./install";
|
||||
export * from "./version";
|
||||
|
||||
@@ -4,6 +4,7 @@ import passport from "passport";
|
||||
import { AppOptions } from "coral-server/app";
|
||||
import {
|
||||
graphQLHandler,
|
||||
healthHandler,
|
||||
installHandler,
|
||||
versionHandler,
|
||||
} from "coral-server/app/handlers";
|
||||
@@ -32,6 +33,9 @@ export function createAPIRouter(app: AppOptions, options: RouterOptions) {
|
||||
// Configure the version route.
|
||||
router.get("/version", versionHandler);
|
||||
|
||||
// Configure the Health route.
|
||||
router.get("/health", healthHandler);
|
||||
|
||||
// Installation middleware.
|
||||
router.use(
|
||||
"/install",
|
||||
|
||||
Reference in New Issue
Block a user