Skip to content

Commit

Permalink
Fix requested changes on health check api
Browse files Browse the repository at this point in the history
  • Loading branch information
balintking committed Aug 3, 2024
1 parent f212748 commit cf10c59
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/backend/src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { Controller, Get } from '@nestjs/common';

import { AppService } from './app.service';

@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}

@Get()
getHello(): string {
return this.appService.getHello();
}
@Get('/health')
getHealth(): string {
return 'Service is up and running';
return this.appService.getHealth();
}
}
2 changes: 2 additions & 0 deletions apps/backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { Module } from '@nestjs/common';
import { PrismaModule } from 'nestjs-prisma';

import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
imports: [PrismaModule.forRoot({ isGlobal: true })],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
12 changes: 12 additions & 0 deletions apps/backend/src/app.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Injectable } from '@nestjs/common';

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

getHealth(): string {
return 'Service is up and running';
}
}

0 comments on commit cf10c59

Please sign in to comment.