@zola_do/health
v0.2.8
Published
NestJS health checks (Terminus) aligned with @zola_do TypeORM, RabbitMQ, and storage env patterns
Maintainers
Readme
@zola_do/health
NestJS readiness/liveness helpers built on @nestjs/terminus, aligned with @zola_do env conventions (TypeORM, RabbitMQ audit, MinIO, Seaweed/S3).
Install
pnpm add @zola_do/health @nestjs/terminusOptional peers (enable related checks only when installed and configured):
@nestjs/typeorm,typeorm— database ping@nestjs/microservices,amqplib— RabbitMQ ping whenRMQ_URLis set
Usage
import { ZolaHealthModule } from '@zola_do/health';
@Module({
imports: [
TypeOrmModule.forRoot(/* ... */),
ZolaHealthModule.forRoot({
path: 'health',
typeorm: true,
rabbitmq: true,
minio: true,
seaweed: true,
http: [{ name: 'docs', url: 'https://example.com/status' }],
}),
],
})
export class AppModule {}path: controller route (defaulthealth→GET /health).typeorm:true(keydatabase), a custom string key, orfalseto skip.rabbitmq: usesRMQ_URLand Terminus microservice ping (requires optional peers above).minio: GEThttp(s)://MINIO_ENDPOINT:MINIO_PORT/minio/health/livefromMINIO_*env vars.seaweed: GETAWS_ENDPOINT(prefixeshttps://if missing); treats HTTP ≥ 500 as down.http: extra{ name, url }GET checks viafetch.
If @nestjs/terminus is not installed, the module registers a minimal GET /health JSON body (mode: 'minimal') so imports stay safe.
Global JWT guard
Use @ZolaHealthPublic() on custom health routes, or rely on the built-in controller: it sets the same allowAnonymous metadata key as @AllowAnonymous() from @zola_do/authorization.
Environment variables
| Check | Variables |
|----------|-----------|
| TypeORM | Same as your app / @zola_do/typeorm (DATABASE_*) |
| RabbitMQ | RMQ_URL |
| MinIO | MINIO_ENDPOINT, MINIO_PORT, MINIO_USESSL |
| Seaweed | AWS_ENDPOINT |
License
ISC
