feat: basic health-checks
This commit is contained in:
@@ -22,6 +22,7 @@ import { Webhooks } from "./controllers/Webhooks";
|
||||
import { V1 } from "./controllers/v1";
|
||||
import { prisma } from "./database/prisma";
|
||||
import { HttpException } from "./exceptions";
|
||||
import { Health } from "./controllers/Health";
|
||||
|
||||
const server = new (class extends Server {
|
||||
public constructor() {
|
||||
@@ -69,6 +70,7 @@ const server = new (class extends Server {
|
||||
new Identities(),
|
||||
new Tasks(),
|
||||
new V1(),
|
||||
new Health(),
|
||||
]);
|
||||
|
||||
this.app.use("*", () => {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Controller, Get } from "@overnightjs/core";
|
||||
import type { Request, Response } from "express";
|
||||
|
||||
@Controller("health")
|
||||
export class Health {
|
||||
@Get("")
|
||||
public async health(req: Request, res: Response) {
|
||||
return res.json({ success: true });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user