Health API
Simple health check endpoints for monitoring and load balancers.
Base Path: /api/health
Authentication: No authentication required.
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
GET | / | No | Basic health check |
GET | /ready | No | Readiness probe |
Health Check
Basic liveness probe that confirms the API is running.
GET /api/healthResponse:
json
{
"status": "ok",
"timestamp": "2025-01-07T10:00:00.000Z"
}Readiness Probe
Extended health check that can include dependency status.
GET /api/health/readyResponse:
json
{
"status": "ok",
"timestamp": "2025-01-07T10:00:00.000Z"
}Usage
Cloudflare Pages Health Check
Configure in wrangler.toml or Cloudflare dashboard:
toml
[site]
health_check = "/api/health"Uptime Monitoring
Use with external monitoring services:
bash
# Simple health check
curl https://app.podcasterplus.com/api/health
# Expected: {"status":"ok","timestamp":"..."}TypeScript Client Usage
typescript
import { createApiClient } from '$api/client';
const client = createApiClient(fetch);
// Health check
const healthRes = await client.api.health.$get();
const { status } = await healthRes.json();
if (status !== 'ok') {
console.error('API health check failed');
}