Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wiki.vivla.com/llms.txt

Use this file to discover all available pages before exploring further.

Health Check

El modulo Health proporciona endpoints publicos para verificar el estado del servicio. Utilizado por Railway, uptime monitors y balanceadores de carga.

Endpoints

Ambos endpoints son publicos (sin autenticacion).

GET /health

Estado basico del servicio.
{
  "status": "healthy",
  "timestamp": "2026-04-10T12:00:00.000Z",
  "version": "1.0.0",
  "environment": "production",
  "commitSha": "abc1234"
}
CampoTipoDescripcion
statushealthy | unhealthyEstado del servicio
timestampISO 8601Momento de la consulta
versionstringVersion de la API
environmentstringdevelopment, staging, production
commitShastring?SHA del commit desplegado (Railway)

GET /health/detailed

Metricas detalladas del servicio.
{
  "status": "healthy",
  "timestamp": "2026-04-10T12:00:00.000Z",
  "version": "1.0.0",
  "environment": "production",
  "database": {
    "responseTime": 12
  },
  "uptime": 86400,
  "memory": {
    "heapUsed": 67108864,
    "heapTotal": 134217728
  }
}
CampoTipoDescripcion
database.responseTimenumberTiempo de respuesta de Supabase (ms)
uptimenumberTiempo de actividad del proceso (segundos)
memory.heapUsednumberMemoria heap utilizada (bytes)
memory.heapTotalnumberMemoria heap total (bytes)

Variables de entorno

VariableRequeridaDescripcion
NODE_ENVNoNombre del entorno
RAILWAY_GIT_COMMIT_SHANoSHA del commit (inyectado por Railway)

Uso en Railway

Railway verifica GET /health periodicamente. Si el endpoint devuelve un status diferente a healthy o no responde, Railway marca el servicio como unhealthy y puede reiniciarlo.

Estructura de modulo

apps/backend/src/health/
  health.module.ts
  health.controller.ts
  health.service.ts
  dto/health-check.dto.ts