From 7ca74970fae6270e49fe77106903d2ff4ca9adfb Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Thu, 9 Apr 2026 15:06:45 -0300 Subject: [PATCH] Added healthcheck route --- .../src/modules/health-check/health-check.routes.ts | 12 ++++++++++++ apps/backend/src/register-routes.ts | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 apps/backend/src/modules/health-check/health-check.routes.ts diff --git a/apps/backend/src/modules/health-check/health-check.routes.ts b/apps/backend/src/modules/health-check/health-check.routes.ts new file mode 100644 index 0000000..2142a86 --- /dev/null +++ b/apps/backend/src/modules/health-check/health-check.routes.ts @@ -0,0 +1,12 @@ +import { AppEnv } from "@/types/hono"; +import { Hono } from "hono"; + +export const healthCheckRoutes = new Hono() + + +healthCheckRoutes.get('/', (c) => { + return c.json({ + status: 'healthy', + timeStamp: new Date() + }, 200) +}) \ No newline at end of file diff --git a/apps/backend/src/register-routes.ts b/apps/backend/src/register-routes.ts index 4be0c1d..ab1da0f 100644 --- a/apps/backend/src/register-routes.ts +++ b/apps/backend/src/register-routes.ts @@ -11,6 +11,7 @@ import { publicBookingRoutes } from '@/modules/public-booking/public-booking.rou import { sportRoutes } from '@/modules/sport/sport.routes' import { userRoutes } from '@/modules/user/user.routes' import type { AppEnv } from '@/types/hono' +import { healthCheckRoutes } from './modules/health-check/health-check.routes' export function registerRoutes(app: Hono) { registerApiRoutes(app, { @@ -24,6 +25,7 @@ export function registerRoutes(app: Hono) { app.route('/api/public-bookings', publicBookingRoutes) app.route('/api/admin-bookings', adminBookingRoutes) + app.route('/api/health', healthCheckRoutes) app.use('*', serveStatic({ root: './public' })) app.get('*', async (c) => {