From 173b65d5fce30bed0a0d7c9f2055e52219cfb4ba Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Sat, 13 Jun 2026 18:51:40 +0300 Subject: [PATCH] feat: add health check endpoint --- .../src/modules/health/health.controller.ts | 16 ++++++++++++++++ apps/backend/src/modules/health/health.module.ts | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 apps/backend/src/modules/health/health.controller.ts create mode 100644 apps/backend/src/modules/health/health.module.ts diff --git a/apps/backend/src/modules/health/health.controller.ts b/apps/backend/src/modules/health/health.controller.ts new file mode 100644 index 0000000..24296ba --- /dev/null +++ b/apps/backend/src/modules/health/health.controller.ts @@ -0,0 +1,16 @@ +import { Controller, Get } from '@nestjs/common'; +import { ApiTags, ApiOperation } from '@nestjs/swagger'; + +@ApiTags('Health') +@Controller('health') +export class HealthController { + @Get() + @ApiOperation({ summary: 'Проверка состояния сервиса' }) + check() { + return { + status: 'ok', + timestamp: new Date().toISOString(), + uptime: process.uptime(), + }; + } +} diff --git a/apps/backend/src/modules/health/health.module.ts b/apps/backend/src/modules/health/health.module.ts new file mode 100644 index 0000000..7476abe --- /dev/null +++ b/apps/backend/src/modules/health/health.module.ts @@ -0,0 +1,7 @@ +import { Module } from '@nestjs/common'; +import { HealthController } from './health.controller'; + +@Module({ + controllers: [HealthController], +}) +export class HealthModule {}