Skip to content

Expose a /api/health Endpoint That Reports Live Status of the Database, Redis, and Stellar Dependencies #232

@mftee

Description

@mftee

Description:
Expose a standalone /api/health endpoint using @nestjs/terminus that reports the live status of all critical dependencies (database, Redis, Stellar).

Tasks:

  • Install @nestjs/terminus
  • Create src/health/health.module.ts and health.controller.ts
  • Add checks: TypeOrmHealthIndicator (database), HttpHealthIndicator (Stellar Horizon URL), a custom RedisHealthIndicator
  • Return 200 OK with a status summary when all checks pass; 503 Service Unavailable when any check fails
  • The endpoint should be publicly accessible (no auth guard)

Acceptance Criteria:

  • GET /api/health returns a JSON body listing the status of each dependency
  • A failing database connection causes the endpoint to return 503
  • The endpoint is excluded from rate limiting

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions