Basic Architecture of Sport Web

This commit is contained in:
Nông Đức Huy
2026-08-11 13:37:25 +07:00
commit 8032fff6ac
262 changed files with 20348 additions and 0 deletions
@@ -0,0 +1,34 @@
import { Controller, Get, HttpCode, HttpStatus } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { Public } from '@/common/decorators/public.decorator';
import { HealthService, type HealthCheckResult } from './health.service';
@ApiTags('health')
@Controller('health')
export class HealthController {
constructor(private readonly healthService: HealthService) {}
/**
* Liveness. Answers "is the process running?" and nothing else — it must not
* touch the database, or a brief DB blip would make the orchestrator kill
* otherwise-healthy containers.
*/
@Public()
@Get('live')
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Liveness probe' })
live(): { status: 'ok' } {
return { status: 'ok' };
}
/** Readiness / deep check: should this instance receive traffic? */
@Public()
@Get()
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Readiness probe with dependency status' })
check(): Promise<HealthCheckResult> {
return this.healthService.check();
}
}