@nestjs/terminus
Nest - modern, fast, powerful node.js web framework (@terminus)
Last updated 9 months ago by brunnerlivio .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @nestjs/terminus 
SYNC missed versions from official npm registry.

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads Travis Linux Discord Backers on Open Collective Sponsors on Open Collective

Description

This module contains integrated healthchecks for Nest.

Installation

@nestjs/terminus integrates with a lot of cool technologies, such as typeorm, grpc, mongodb, and many more! In case you have missed a dependency, @nestjs/terminus will throw an error and prompt you to install the required dependency. So you will only install what is actually required!


npm install @nestjs/terminus

Usage

  1. Import the Terminus module
  2. Make sure the addtionally needed modules are available to (e.g. TypeOrmModule), in case you want to do Database Health Checks.
// app.module.ts

@Module({
  controllers: [HealthController],
  imports:[
    // Make sure TypeOrmModule is available in the module context
    TypeOrmModule.forRoot({ ... }),
    TerminusModule
  ],
})
export class HealthModule { }

  1. Setup your HealthController which executes your Health Check.
// health.controller.ts

@Controller('health')
export class HealthController {
  constructor(
    private health: HealthCheckService,
    private db: TypeOrmHealthIndicator,
  ) {}

  @Get()
  @HealthCheck()
  readiness() {
    return this.health.check([
      () => async () => this.db.pingCheck('database', { timeout: 300 }),
    ]);
  }
}

If everything is set up correctly, you can access the healthcheck on http://localhost:3000/health.


{
  "status": "ok",
  "info": {
    "database": {
      "status": "up"
    }
  },
  "details": {
    "database": {
      "status": "up"
    }
  }
}
    

For more information, see docs. You can find more samples in the samples/ folder of this repository.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

Current Tags

  • 7.0.1                                ...           latest (9 months ago)
  • 7.0.0-pre.5                                ...           next (10 months ago)

33 Versions

  • 7.0.1                                ...           9 months ago
  • 7.0.0                                ...           10 months ago
  • 7.0.0-pre.5                                ...           10 months ago
  • 7.0.0-pre.4                                ...           10 months ago
  • 7.0.0-pre.3                                ...           10 months ago
  • 7.0.0-pre.2                                ...           10 months ago
  • 7.0.0-pre.1                                ...           10 months ago
  • 6.5.6                                ...           a year ago
  • 6.5.5                                ...           a year ago
  • 6.5.4                                ...           a year ago
  • 6.5.3                                ...           a year ago
  • 6.5.2                                ...           a year ago
  • 6.5.1                                ...           a year ago
  • 6.5.0                                ...           2 years ago
  • 6.4.0                                ...           2 years ago
  • 6.3.4                                ...           2 years ago
  • 6.3.3                                ...           2 years ago
  • 6.3.1                                ...           2 years ago
  • 6.3.0-rc.1                                ...           2 years ago
  • 6.3.0                                ...           2 years ago
  • 6.2.0                                ...           2 years ago
  • 6.2.0-rc.0                                ...           2 years ago
  • 6.1.5                                ...           2 years ago
  • 6.1.4                                ...           2 years ago
  • 6.1.3                                ...           2 years ago
  • 6.1.2                                ...           2 years ago
  • 6.1.1                                ...           2 years ago
  • 6.1.0                                ...           2 years ago
  • 6.0.0                                ...           2 years ago
  • 5.6.0                                ...           2 years ago
  • 5.5.2                                ...           2 years ago
  • 5.5.1                                ...           2 years ago
  • 5.5.0                                ...           2 years ago
Downloads
Today 0
This Week 29
This Month 753
Last Day 29
Last Week 228
Last Month 992
Dependencies (2)

Copyright 2014 - 2017 © taobao.org |