Node.js2 minutes to readChecked

Add an HTTPS readiness check to a GitHub-deployed web app

Add a health route to a Node.js HTTP app, verify it on the platform URL, and confirm that each GitHub deploy serves the expected revision.

Give the web app a dedicated health route

A Node.js process can be running while its public routes still fail. On a compatible GitHub-linked HTTP deployment, the readiness check sends a GET to the platform HTTPS address after startup. Use a dedicated route when the app has no page at / or its home page redirects to login.

Add this handler to your existing Express app before login redirects and catch-all routes. Have it return a small response once the app can accept requests. Return 503 while an essential startup task is still pending. Keep database credentials, configuration details and other private data out of the response.

An Express readiness route
app.get('/healthz', (_req, res) => {
  res.status(200).json({ status: 'ready' });
});

Use the assigned SERVER_PORT and bind to 0.0.0.0. See the Node.js deployment guide.

Test the route before changing the deployment check

Push the route and deploy it with the current readiness setting, or test it on a separate deployment first. Copy the platform HTTPS origin from Settings → HTTP domains into APP_URL in your shell. Request the new route with the same method the readiness check uses.

Request the health route over HTTPS
curl -sS -i "$APP_URL/healthz"

Look for a 200 and the JSON response. A 404 points to the path or route order. A redirect can count as ready, so check the status and body yourself. If the endpoint is unreachable, confirm the listener and inspect Console for startup or build errors.

Save the path and verify the next revision

Open Deploy → Git revisions → HTTPS readiness check, enter /healthz and save. Use a plain path on your deployment. The check accepts HTTP 2xx and 3xx responses. Push a small change to the connected branch or select Deploy latest.

Wait for Recent deploys to report the outcome. Compare Active Git revision with the SHA you pushed, then test one route that uses the changed code. If the check fails, use the recorded deploy stage and Console to tell a failed build from an HTTP readiness failure. GitHub deployment and rollback guide.