feat: add health check endpoint
This commit is contained in:
parent
5dcc1e12be
commit
173b65d5fc
16
apps/backend/src/modules/health/health.controller.ts
Normal file
16
apps/backend/src/modules/health/health.controller.ts
Normal file
@ -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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
7
apps/backend/src/modules/health/health.module.ts
Normal file
7
apps/backend/src/modules/health/health.module.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { HealthController } from './health.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [HealthController],
|
||||
})
|
||||
export class HealthModule {}
|
||||
Loading…
x
Reference in New Issue
Block a user