From 4c9f8ed4e8f9de7f466e6ae0190c1cf4357b7b3e Mon Sep 17 00:00:00 2001 From: Balu Babu Date: Wed, 23 Aug 2023 19:17:07 +0530 Subject: [PATCH] chore: added ping route in backend for healthcheck in prod.Dockerfile --- packages/hoppscotch-backend/src/app.controller.ts | 9 +++++++++ packages/hoppscotch-backend/src/app.module.ts | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 packages/hoppscotch-backend/src/app.controller.ts diff --git a/packages/hoppscotch-backend/src/app.controller.ts b/packages/hoppscotch-backend/src/app.controller.ts new file mode 100644 index 000000000..8ce570ea3 --- /dev/null +++ b/packages/hoppscotch-backend/src/app.controller.ts @@ -0,0 +1,9 @@ +import { Controller, Get } from '@nestjs/common'; + +@Controller('ping') +export class AppController { + @Get() + ping(): string { + return 'Success'; + } +} diff --git a/packages/hoppscotch-backend/src/app.module.ts b/packages/hoppscotch-backend/src/app.module.ts index 63a5bd579..eb0581bb5 100644 --- a/packages/hoppscotch-backend/src/app.module.ts +++ b/packages/hoppscotch-backend/src/app.module.ts @@ -19,6 +19,7 @@ import { UserCollectionModule } from './user-collection/user-collection.module'; import { ShortcodeModule } from './shortcode/shortcode.module'; import { COOKIES_NOT_FOUND } from './errors'; import { ThrottlerModule } from '@nestjs/throttler'; +import { AppController } from './app/app.controller'; @Module({ imports: [ @@ -81,5 +82,6 @@ import { ThrottlerModule } from '@nestjs/throttler'; ShortcodeModule, ], providers: [GQLComplexityPlugin], + controllers: [AppController], }) export class AppModule {}