mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 08:13:49 +10:00
add back health module to server
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "reactive-resume",
|
"name": "reactive-resume",
|
||||||
"version": "3.7.4",
|
"version": "3.7.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "env-cmd --silent cross-var cross-env VERSION=$npm_package_version turbo run dev",
|
"dev": "env-cmd --silent cross-var cross-env VERSION=$npm_package_version turbo run dev",
|
||||||
|
|||||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -326,6 +326,9 @@ importers:
|
|||||||
'@types/passport':
|
'@types/passport':
|
||||||
specifier: ^1.0.12
|
specifier: ^1.0.12
|
||||||
version: 1.0.12
|
version: 1.0.12
|
||||||
|
axios:
|
||||||
|
specifier: ^1.4.0
|
||||||
|
version: 1.4.0
|
||||||
bcryptjs:
|
bcryptjs:
|
||||||
specifier: ^2.4.3
|
specifier: ^2.4.3
|
||||||
version: 2.4.3
|
version: 2.4.3
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
"@nestjs/terminus": "^9.2.2",
|
"@nestjs/terminus": "^9.2.2",
|
||||||
"@nestjs/typeorm": "^9.0.1",
|
"@nestjs/typeorm": "^9.0.1",
|
||||||
"@types/passport": "^1.0.12",
|
"@types/passport": "^1.0.12",
|
||||||
|
"axios": "^1.4.0",
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"cache-manager": "^5.2.2",
|
"cache-manager": "^5.2.2",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@ -50,7 +51,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
"@nestjs/schematics": "^9.2.0",
|
"@nestjs/schematics": "^9.2.0",
|
||||||
"schema": "workspace:*",
|
|
||||||
"@types/bcryptjs": "^2.4.2",
|
"@types/bcryptjs": "^2.4.2",
|
||||||
"@types/cookie-parser": "^1.4.3",
|
"@types/cookie-parser": "^1.4.3",
|
||||||
"@types/express": "^4.17.17",
|
"@types/express": "^4.17.17",
|
||||||
@ -64,6 +64,7 @@
|
|||||||
"eslint-plugin-unused-imports": "^2.0.0",
|
"eslint-plugin-unused-imports": "^2.0.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
|
"schema": "workspace:*",
|
||||||
"source-map-support": "^0.5.21",
|
"source-map-support": "^0.5.21",
|
||||||
"ts-loader": "^9.4.3",
|
"ts-loader": "^9.4.3",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import { ConfigModule } from './config/config.module';
|
|||||||
import { DatabaseModule } from './database/database.module';
|
import { DatabaseModule } from './database/database.module';
|
||||||
import { AllExceptionsFilter } from './filters/all-exceptions.filter';
|
import { AllExceptionsFilter } from './filters/all-exceptions.filter';
|
||||||
import { FontsModule } from './fonts/fonts.module';
|
import { FontsModule } from './fonts/fonts.module';
|
||||||
|
import { HealthModule } from './health/health.module';
|
||||||
import { IntegrationsModule } from './integrations/integrations.module';
|
import { IntegrationsModule } from './integrations/integrations.module';
|
||||||
import { MailModule } from './mail/mail.module';
|
import { MailModule } from './mail/mail.module';
|
||||||
import { PrinterModule } from './printer/printer.module';
|
import { PrinterModule } from './printer/printer.module';
|
||||||
@ -32,6 +33,7 @@ import { UsersModule } from './users/users.module';
|
|||||||
FontsModule,
|
FontsModule,
|
||||||
IntegrationsModule,
|
IntegrationsModule,
|
||||||
PrinterModule,
|
PrinterModule,
|
||||||
|
HealthModule,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
|
|||||||
22
server/src/health/health.controller.ts
Normal file
22
server/src/health/health.controller.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { Controller, Get } from '@nestjs/common';
|
||||||
|
import { HealthCheck, HealthCheckService, HttpHealthIndicator, TypeOrmHealthIndicator } from '@nestjs/terminus';
|
||||||
|
|
||||||
|
@Controller('health')
|
||||||
|
export class HealthController {
|
||||||
|
constructor(
|
||||||
|
private health: HealthCheckService,
|
||||||
|
private http: HttpHealthIndicator,
|
||||||
|
private db: TypeOrmHealthIndicator
|
||||||
|
) {}
|
||||||
|
|
||||||
|
@Get()
|
||||||
|
@HealthCheck()
|
||||||
|
check() {
|
||||||
|
return this.health.check([
|
||||||
|
() => this.http.pingCheck('app', 'https://rxresu.me'),
|
||||||
|
() => this.http.pingCheck('blog', 'https://blog.rxresu.me'),
|
||||||
|
() => this.http.pingCheck('docs', 'https://docs.rxresu.me'),
|
||||||
|
() => this.db.pingCheck('database'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
server/src/health/health.module.ts
Normal file
11
server/src/health/health.module.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { HttpModule } from '@nestjs/axios';
|
||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { TerminusModule } from '@nestjs/terminus';
|
||||||
|
|
||||||
|
import { HealthController } from './health.controller';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [TerminusModule, HttpModule],
|
||||||
|
controllers: [HealthController],
|
||||||
|
})
|
||||||
|
export class HealthModule {}
|
||||||
Reference in New Issue
Block a user