@enoviah/nest-health
v0.0.1
Published
Nest module to handle health status
Downloads
31
Readme
Nest health module
The purpose of this module is to be used with nest rest api in order to open a /health route This route has 2 objectifs :
- Expose a /health route
- Turn on tracking of api status by eno-health-apo
You need to import the module in any nest api related to enoviah.
Installation
npm install @enoviah/nest-healthConfiguration
In order to enable the health module, you will need to import the module into a nest module :
import { HealthModule, HealthService } from '@enoviah/nest-health';
@Module({
imports: [HealthModule],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {
constructor(private healthService: HealthService) {
// this is optional but we encourage you to define service name
this.healthService.healthStatus.service = 'Health api';
}
}
That's all, you can deploy your api
Build & Usage
you can manually build & use this package without npm install. First step is to dpwnload this repo. Then, we install dependencies & run
npm run buildIf you want yo use the build result as a local npm package, just run
npm linkNext, in your nest api, run:
npm link @enoviah/nest-healthand that's it
