For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quickstart: Health Endpoint

Ship a minimal health endpoint before you add upstream integrations so deploys are observable from day one. The config returns a static JSON response with no

Ship a minimal health endpoint before you add upstream integrations so deploys are observable from day one. The config returns a static JSON response with no upstream dependency, making it ideal for load balancer checks. Use this as your first route when bootstrapping a new gateway.

Last reviewed: 2026-03-06

When to use this

Use these quickstart guides when you are setting up Serverless API Gateway for the first time or adding a new integration pattern. Each guide walks through one isolated concern so you can deploy incrementally instead of configuring everything at once.

Key concepts

  • Every quickstart produces a deployable wrangler.toml and JSON config pair -- you can run wrangler deploy at the end of each guide.

  • Guides are ordered from simplest (health endpoint) to most complex (Auth0/Supabase passwordless), so earlier guides serve as prerequisites for later ones.

  • Config can come from a local file, Cloudflare KV, or the SAG_API_CONFIG_JSON environment variable -- choose based on your deploy workflow.

  • All guides use the same JSON config schema, so patterns you learn in one guide transfer directly to others.

Repo-grounded example

{
  "$schema": "./api-config.schema.json",
  "title": "Minimal Gateway",
  "cors": {
    "allow_origins": ["https://app.example.com"],
    "allow_methods": ["GET", "POST", "OPTIONS"],
    "allow_headers": ["Content-Type", "Authorization"],
    "expose_headers": ["X-Request-Id"],
    "allow_credentials": true,
    "max_age": 300
  },
  "paths": [
    {
      "method": "GET",
      "path": "/health",
      "response": { "status": "ok" }
    }
  ]
}

This snippet shows the smallest valid gateway config: a CORS policy and a single GET route that returns a static JSON object. The response field replaces the need for an upstream service or integration.

Troubleshooting

  • If wrangler deploy fails with a config error, validate your JSON against the schema file (api-config.schema.json) before investigating further.

  • If the health endpoint returns 404, confirm that your wrangler.toml points to the correct main entrypoint and that the config file is being loaded.

  • If JWT or Auth0 routes return 500, check that all required environment variables and secrets are set in your Cloudflare dashboard or .dev.vars file.

  • Use wrangler tail to stream live logs from the deployed worker and see the exact error message the gateway produces.

Last updated