Skip to content

Commit

Permalink
feat: status
Browse files Browse the repository at this point in the history
  • Loading branch information
Ealenn committed Feb 5, 2024
1 parent 96dad8b commit d49b1cf
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 3 deletions.
157 changes: 156 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-fastify": "^10.3.1",
"@nestjs/swagger": "^7.2.0",
"@nestjs/terminus": "^10.2.1",
"@nestjs/typeorm": "^10.0.1",
"handlebars": "^4.7.8",
"hbs": "^4.2.0",
Expand Down
6 changes: 4 additions & 2 deletions src/app/api/api.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Module } from '@nestjs/common';
import { UsersController } from './users/users.controller';
import { ServicesModule } from '../services/services.module';
import { StatusController } from './status/status.controller';
import { TerminusModule } from '@nestjs/terminus';

@Module({
imports: [ServicesModule],
controllers: [UsersController],
imports: [TerminusModule, ServicesModule],
controllers: [UsersController, StatusController],
providers: [],
})
export class ApiModule {}
20 changes: 20 additions & 0 deletions src/app/api/status/status.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Controller, Get } from '@nestjs/common';
import { ApiTags, ApiUnauthorizedResponse } from '@nestjs/swagger';
import {
HealthCheck,
HealthCheckResult,
HealthCheckService,
} from '@nestjs/terminus';

@ApiTags('Status')
@ApiUnauthorizedResponse()
@Controller('/api/status')
export class StatusController {
constructor(private health: HealthCheckService) {}

@Get()
@HealthCheck()
check(): Promise<HealthCheckResult> {
return this.health.check([]);
}
}

0 comments on commit d49b1cf

Please sign in to comment.