Skip to content

Commit

Permalink
[FEAT] health check api
Browse files Browse the repository at this point in the history
  • Loading branch information
yubinquitous committed May 6, 2024
1 parent 4bab4ef commit 3fe1337
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { UsersModule } from './users/users.module';
import { ScheduleModule } from '@nestjs/schedule';
import { UserRepositoryModule } from './user-repository/user-repository.module';
import { FriendsModule } from './friends/friends.module';
import { HealthModule } from './health/health.module';
import userConfig from './config/user.config';
import googleConfig from './config/google.config';
import s3Config from './config/s3.config';
Expand Down Expand Up @@ -60,6 +61,7 @@ import s3Config from './config/s3.config';
UsersModule,
RedisModule,
SwaggerModule,
HealthModule,
],
controllers: [AppController],
providers: [AppService],
Expand Down
14 changes: 14 additions & 0 deletions src/health/health.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Controller } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';

@Controller('health')
@ApiTags('health')
export class HealthController {
@ApiOperation({
summary: '헬스 체크',
description: '서버의 상태를 체크합니다.',
})
async healthCheck() {
return 'ok';
}
}
7 changes: 7 additions & 0 deletions src/health/health.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { HealthController } from './health.controller';

@Module({
controllers: [HealthController],
})
export class HealthModule {}

0 comments on commit 3fe1337

Please sign in to comment.