Skip to content

Commit

Permalink
feat: 🚀 add GET /health endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Ruck <git@manuelruck.de>
  • Loading branch information
Manuel Ruck authored and ManAnRuck committed Sep 22, 2024
1 parent a4fd5b0 commit 9a8ee26
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
20 changes: 20 additions & 0 deletions services/procedures/bruno/health.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: health
type: http
seq: 3
}

get {
url: {{url}}/health
body: none
auth: none
}

assert {
res.body: eq ok!
res.status: eq 200
}

docs {
This endpoint is to check if the service is healthy
}
2 changes: 1 addition & 1 deletion services/procedures/src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('AppController', () => {

describe('root', () => {
it('should return "Hello World!"', () => {
expect(appController.getHello()).toBe('Hello World!');
expect(appController.health()).toBe('ok!');
});
});
});
6 changes: 3 additions & 3 deletions services/procedures/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { AppService } from './app.service';
export class AppController {
constructor(private readonly appService: AppService) {}

@Get()
getHello(): string {
return this.appService.getHello();
@Get('health')
health(): string {
return this.appService.health();
}
}
4 changes: 2 additions & 2 deletions services/procedures/src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
getHello(): string {
return 'Hello World!';
health(): string {
return 'ok!';
}
}

0 comments on commit 9a8ee26

Please sign in to comment.