Skip to content

AppController

reference
1 min readUpdated

Kind: Controller

Source: atloria-monorepo/apps/sdk-worker/src/app/app.controller.ts

Probe endpoint (k8s liveness/readiness).

AppController exposes the SDK worker's lightweight probe endpoint for Kubernetes liveness and readiness checks. It provides a minimal HTTP response that infrastructure can use to verify that the worker process is reachable and able to serve requests.

Diagram

mermaid
graph LR
  K8s[Kubernetes kubelet] -->|HTTP probe request| Controller[AppController]
  Controller -->|Health/probe response| K8s
  Controller --> Worker[SDK Worker application]

Usage

ts
import { Controller, Get } from '@nestjs/common';

@Controller()
export class AppController {
  @Get()
  probe(): { status: string } {
    return { status: 'ok' };
  }
}

// Kubernetes example:
// livenessProbe:
//   httpGet:
//     path: /
//     port: 3000
//
// readinessProbe:
//   httpGet:
//     path: /
//     port: 3000

AI Coding Instructions

  • Keep probe handlers fast, deterministic, and free of expensive SDK or database operations.
  • Preserve the route and response contract used by Kubernetes manifests and deployment configuration.
  • Use NestJS decorators and dependency injection conventions when adding controller behavior.
  • Separate infrastructure health checks from business-facing SDK worker endpoints.
  • If readiness depends on external services, distinguish readiness failures from basic process liveness.

Relationships

  • MODULE_DECLARES → health

Was this page helpful?

Download as PDF