Health check

GET /health endpoint with NestJS Terminus — database and optional Redis.

Opt-in feature installed with kl-nest new (multiselect) or kl-nest add health.

Exposes GET /health using @nestjs/terminus. The endpoint is public (@IsPublic()) and excluded from OpenAPI (@ApiExcludeEndpoint()).

Indicator When it runs
Database Always — TypeORM ping
Redis Only when REDIS_CONNECTION_STRING is set in .env

If REDIS_CONNECTION_STRING is set but the ioredis package is not installed (Redis cache was not added), the indicator returns up with a warning instead of failing the health check.

text
src/host/controllers/health-check/
├── health-check.controller.ts
└── health-check.module.ts

src/infra/services/
├── database.indicator.service.ts
└── redis.indicator.service.ts

The CLI registers HealthCheckModule in AppModule.

json
{
  "status": "ok",
  "info": {
    "database": { "status": "up" },
    "redis": { "status": "up" }
  },
  "error": {},
  "details": {
    "database": { "status": "up" },
    "redis": { "status": "up" }
  }
}
Variable Health effect
REDIS_CONNECTION_STRING Enables Redis check
Other DB vars Used by TypeORM ping

Koala Nest

A facilitator for building NestJS APIs with DDD architecture. Code copied into your repository — readable, adaptable, and under your control.

Creator

igordrangel.com.br

Design, back-end, and product strategy.

Quick Commands

Global CLI and scripts in the generated project

  • bun install -g @koalarx/nest
  • kl-nest new
  • kl-nest add cache
  • bun run migration:run # CRUD template
  • kl-nest --help
© 2026 Koala NestBuilt for NestJS developers and AI-assisted workflows.