Skip to content

feat(frontend): add /api/health endpoint and point compose healthcheck at it - #325

Open
jeffrey-graham wants to merge 1 commit into
prism-explorer:mainfrom
jeffrey-graham:feat/add-frontend-api-health-endpoint-312
Open

jeffrey-graham wants to merge 1 commit into
prism-explorer:mainfrom
jeffrey-graham:feat/add-frontend-api-health-endpoint-312

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Summary

  • Adds an unrated GET /api/health route (frontend/src/app/api/health/route.ts):
    • Default cheap liveness check (GET /api/health) responds immediately with 200 OK ({ "status": "ok" }, Cache-Control: no-store) without calling Horizon, Soroban RPC, or PostgreSQL.
    • Optional deep check (GET /api/health?deep=1) probes Horizon, Soroban RPC (getHealth), and PostgreSQL (SELECT 1 when DATABASE_URL is configured), returning 200 when all dependencies are healthy and 503 with per-dependency status/error details when any dependency fails.
  • Updates the frontend service healthcheck in docker-compose.yml to probe http://127.0.0.1:3000/api/health instead of /.
  • Adds unit tests in frontend/src/app/api/health/route.test.ts covering liveness and deep dependency failure reporting.

Verification

  • Ran npx eslint src/app/api/health/route.ts src/app/api/health/route.test.ts src/lib/indexed-db.ts and npx vitest run src/app/api/health/route.test.ts src/lib/indexed-db.test.ts in frontend/.

Closes #312

@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@jeff-graham-ai is attempting to deploy a commit to the thewealthyplace100-8633's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a /api/health endpoint for the frontend healthcheck

2 participants