C
CanxJS
v1.6.2
  • Learn
  • Blog
  • Showcase
C
CanxJS

Ultra-fast async MVC backend framework for Bun. Build production-ready APIs with elegance and speed.

Resources

  • Documentation
  • Learn
  • Blog
  • Showcase

Documentation

  • Introduction
  • Installation
  • Core Concepts
  • CLI Commands
  • API Reference

Legal

  • Privacy Policy
  • Terms of Service

© 2026 CanxJS. All rights reserved.

Built with ❤️ for Candra Kirana

  • Aspect-Oriented (AOP)
  • CQRS Architecture
  • GraphQL API
  • Tracing
  • Health Checks
Monitoring

Health Checks

Monitor your application's state with built-in health indicators. Perfect for Kubernetes readiness/liveness probes.

Liveness/Readiness

Standardized health checks for Kubernetes.

Indicators

Built-in checks for DB, Memory, and Disk.

Customizable

Create your own custom health indicators.

Usage

Import the `HealthModule` and inject the service.

app.module.ts
1import { Module } from "canxjs";
2import { HealthModule } from "canxjs/health";
3
4@Module({
5 imports: [HealthModule],
6 controllers: [HealthController],
7})
8export class AppModule {}

Custom Endpoint

health.controller.ts
1import { Controller, Get, Inject } from "canxjs";
2import { HealthCheckService, DatabaseHealthIndicator, DiskHealthIndicator } from "canxjs/health";
3
4@Controller('health')
5export class HealthController {
6 constructor(
7 private health: HealthCheckService,
8 private db: DatabaseHealthIndicator,
9 private disk: DiskHealthIndicator,
10 ) {}
11
12 @Get()
13 check() {
14 return this.health.check([
15 () => this.db.pingCheck('database'),
16 () => this.disk.checkStorage('storage', { path: '/', thresholdPercent: 0.9 })
17 ]);
18 }
19}

Response Format

response.json
1{
2 "status": "ok",
3 "info": {
4 "database": {
5 "status": "up"
6 },
7 "storage": {
8 "status": "up"
9 }
10 },
11 "error": {},
12 "details": {
13 "database": {
14 "status": "up"
15 },
16 "storage": {
17 "status": "up"
18 }
19 }
20}