Skip to content

Commit

Permalink
feat: aws alb health check endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonCRocha committed May 16, 2024
1 parent 718a620 commit 5d896c3
Show file tree
Hide file tree
Showing 4 changed files with 38 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 @@ -12,6 +12,7 @@ import { SupplyCategoriesModule } from './supply-categories/supply-categories.mo
import { ShelterManagersModule } from './shelter-managers/shelter-managers.module';
import { ShelterSupplyModule } from './shelter-supply/shelter-supply.module';
import { PartnersModule } from './partners/partners.module';
import { HealthModule } from './health/health.module';

@Module({
imports: [
Expand All @@ -24,6 +25,7 @@ import { PartnersModule } from './partners/partners.module';
ShelterManagersModule,
ShelterSupplyModule,
PartnersModule,
HealthModule,
],
controllers: [],
providers: [
Expand Down
18 changes: 18 additions & 0 deletions src/health/health.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { HealthController } from './health.controller';

describe('HealthController', () => {
let controller: HealthController;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [HealthController],
}).compile();

controller = module.get<HealthController>(HealthController);
});

it('should be defined', () => {
expect(controller).toBeDefined();
});
});
11 changes: 11 additions & 0 deletions src/health/health.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Controller, Get } from '@nestjs/common';

@Controller('health')
export class HealthController {
@Get()
status() {
return {
state: 'UP',
};
}
}
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 5d896c3

Please sign in to comment.