@healthzkit/paas maps one platform health URL onto a healthzkit liveness, readiness, or startup probe. Fly, Railway, Render, and the other long-lived platforms below request that URL themselves. Vercel does not; its export serves /api/health for uptime monitors.
platform.path: /healthz on Fly, /health on Railway and Render, /api/health on Vercel. You can still mount /healthz/live, /healthz/ready, and /healthz/startup beside that URL.
The handler accepts GET and HEAD. Any other method on that pathname returns 405 with Allow: GET, HEAD. A different pathname makes platform.handle() and createPaasFetchHandler return null, so the request can fall through. Status codes are passed through. platform.handle() and handlePaas() keep the kit body as a string, including for 204, 205, and 304. createPaasFetchHandler omits that body, because Fetch rejects it on those statuses. Defaults are 200 for ok and degraded, and 503 for a failed readiness check. Keep a custom onFail.httpStatus outside platform.healthyStatus. A failure status inside that range looks healthy to the platform.
platform.metadata is non-secret runtime identity for logs. The handler does not copy it into the HTTP body. Many of these paths are reachable on the public internet. The example uses status-only output. See Responses and HTTP.
Listen on 0.0.0.0 and the platform PORT. On a long-lived service, schedule slow dependency checks so the platform timeout is not spent waiting on a database. On Vercel, skip kit.start() and run checks on each request.
Package entrypoints
Each platform subpath also exports
createPaasFetchHandler and handlePaas.
Contracts
fly({ path, check, env }) overrides the pathname and the probe. check defaults to "readiness". Pass env in tests. Otherwise the factory reads process.env.
detectPaas(env?) returns every profile whose runtime marker is present, in the table order. DigitalOcean App Platform has no marker this package recognizes. Call digitalOcean() when you deploy there.
Fly.io
Service HTTP checks expect a 2xx response and do not follow redirects. A 301 or 302 fails the check. Serve/healthz directly, including when the rest of the app redirects HTTP to HTTPS. Fly calls the Machine over the private network, not the public fly.dev hostname. A failing check stops routing and does not restart the Machine.
timeout to at least the healthzkit check deadline. The default deadline is 5 seconds. fly().metadata may include app, region, machine, and processGroup.
Vercel
vercel() serves /api/health and adds CDN-Cache-Control: no-store and Vercel-CDN-Cache-Control: no-store beside healthzkit’s Cache-Control: no-store. Exclude the path from auth middleware. Deployment protection still applies to preview URLs. Skip kit.start() on serverless.
vercel().metadata may include env, region, deployment, project, commit, and ref.
Railway
Railway requests the healthcheck path during deploy and accepts any 2xx before it shifts traffic. It does not keep probing after the deploy is live. The Host header ishealthcheck.railway.app. Allow that host when the app filters Host. Listen on PORT. The default deploy window is 300 seconds (RAILWAY_HEALTHCHECK_TIMEOUT_SEC).
Render
Render web services send GET and accept 2xx or 3xx within 5 seconds. The Host header is a verified custom domain, or theonrender.com hostname when there is none. Consecutive failures stop routing after 15 seconds and restart the instance after 60 seconds. A dependency failure on this path can restart the process. Private services use TCP checks only.
Cloud Run
Cloud Run treats 2xx and 3xx as success. The default HTTP probe timeout is 1 second, which is shorter than healthzkit’s 5 second check deadline. Raise the probe timeout or keep the checks inside it. Readiness stops new traffic and leaves the instance running. Liveness shuts the instance down. UsecloudRun({ path: "/live", check: "liveness" }) only for failures a restart can fix. Cloud Run can route traffic as soon as the startup probe passes, so a startup probe has to mean the instance can serve.
Koyeb
Koyeb’s default check is TCP and does not call this path. Switch the port’s health check to HTTP, method GET, and path/health. Success is 2xx or 3xx. The default timeout is 5 seconds, and the default of 3 consecutive failures restarts the instance. The same check also gates startup.
DigitalOcean App Platform
Sethttp_path, or App Platform keeps using TCP. HTTP success is 200 through 399. The default timeout_seconds is 1. health_check is the readiness path this export serves. liveness_health_check restarts the component. Pass check: "liveness" only for that probe. detected stays false.
Azure App Service
There is no default path. Set/health in the Health check blade. App Service accepts 200 through 299, pings about once a minute, and treats a response slower than one minute as failed. It does not follow redirects. Allow anonymous access to the path when the app has its own auth. An instance that stays unhealthy for one hour can be replaced.
Azure Container Apps
HTTP probes succeed on 200 through 399. The default timeout is 1 second. Readiness stops new traffic. Liveness restarts the replica. Passcheck: "liveness" only for that probe.