From 956a9b58dd00a65d65f1c49e5334c1ef9606bce2 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Tue, 10 Feb 2026 00:22:40 +0200 Subject: [PATCH] fix(server): register SystemDatabaseController and add PublicRoute decorator - Register SystemDatabaseController in SystemDatabaseModule to expose /api/system_db endpoint - Add PublicRoute decorator to bypass authentication for healthcheck endpoint - Update ping() method to return { status: 'ok' } with HTTP 200 This fixes the Docker healthcheck that was failing with 404 Not Found errors. Co-Authored-By: Claude Sonnet 4.5 --- .../modules/System/SystemDB/SystemDB.controller.ts | 12 +++++++----- .../src/modules/System/SystemDB/SystemDB.module.ts | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/server/src/modules/System/SystemDB/SystemDB.controller.ts b/packages/server/src/modules/System/SystemDB/SystemDB.controller.ts index ca010fd99..af4e98217 100644 --- a/packages/server/src/modules/System/SystemDB/SystemDB.controller.ts +++ b/packages/server/src/modules/System/SystemDB/SystemDB.controller.ts @@ -1,12 +1,14 @@ -import { Controller, Get, Post } from '@nestjs/common'; +import { Controller, Get, HttpCode } from '@nestjs/common'; +import { PublicRoute } from '@/modules/Auth/guards/jwt.guard'; -@Controller('/system_db') +@Controller('system_db') +@PublicRoute() export class SystemDatabaseController { constructor() {} - @Post() @Get() - ping(){ - + @HttpCode(200) + ping() { + return { status: 'ok' }; } } diff --git a/packages/server/src/modules/System/SystemDB/SystemDB.module.ts b/packages/server/src/modules/System/SystemDB/SystemDB.module.ts index d1387efa5..6c3610385 100644 --- a/packages/server/src/modules/System/SystemDB/SystemDB.module.ts +++ b/packages/server/src/modules/System/SystemDB/SystemDB.module.ts @@ -6,6 +6,7 @@ import { SystemKnexConnectionConfigure, } from './SystemDB.constants'; import { knexSnakeCaseMappers } from 'objection'; +import { SystemDatabaseController } from './SystemDB.controller'; const providers = [ { @@ -42,6 +43,7 @@ const providers = [ @Global() @Module({ + controllers: [SystemDatabaseController], providers: [...providers], exports: [...providers], })