Skip to content

chore(self-hosting): add health check endpoint - #3562

Merged
waleedlatif1 merged 1 commit into
simstudioai:stagingfrom
PlaneInABottle:chore/self-hosting-health-check
Mar 13, 2026
Merged

chore(self-hosting): add health check endpoint#3562
waleedlatif1 merged 1 commit into
simstudioai:stagingfrom
PlaneInABottle:chore/self-hosting-health-check

Conversation

@PlaneInABottle

Copy link
Copy Markdown
Contributor

Summary

  • add a lightweight GET /api/health endpoint for deployment platforms and container probes
  • return a simple ok payload with an ISO timestamp so self-hosted runtimes have a stable readiness target
  • cover the route with a focused Vitest spec

Validation

  • bun --cwd apps/sim vitest run app/api/health/route.test.ts
  • bunx @biomejs/biome check apps/sim/app/api/health/route.ts apps/sim/app/api/health/route.test.ts

Add a simple API health route for deployment platforms and container probes, with focused route coverage.
@cursor

cursorBot commented Mar 13, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Adds a simple, read-only health endpoint and a small unit test; low impact with minimal integration surface.

Overview
Adds a lightweight GET /api/health route that returns { status: 'ok', timestamp: <ISO string> } with HTTP 200 for probe/readiness checks.

Includes a focused Vitest spec (route.test.ts) that calls GET() directly and asserts the response status and payload shape.

Written by Cursor Bugbot for commit 0c00560. This will update automatically on new commits. Configure here.

@vercel

vercelBot commented Mar 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedMar 13, 2026 9:01am

Request Review

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a lightweight GET /api/health endpoint intended for deployment platforms and container liveness/readiness probes. It returns { status: "ok", timestamp: "<ISO string>" } with HTTP 200 and is covered by a single Vitest spec that validates both the status code and the response shape.

  • New apps/sim/app/api/health/route.ts: uses the native Response.json() API (idiomatic for Next.js App Router), the explicit { status: 200 } option is redundant but harmless and improves readability.
  • New apps/sim/app/api/health/route.test.ts: correct @vitest-environment node directive, uses the @/ path alias correctly, and asserts both the HTTP status and the JSON body shape.
  • The endpoint is unauthenticated by design (health probes must be publicly reachable), which is appropriate.
  • No database or dependency checks are performed — this is a pure liveness signal, which is a reasonable starting point for self-hosting.

Confidence Score: 5/5

  • This PR is safe to merge — it adds two new files with no modifications to existing code.
  • The change is entirely additive (two new files), the implementation is minimal and correct, the endpoint is appropriately unauthenticated for a health probe, and the test covers the expected behaviour. No existing functionality is touched.
  • No files require special attention.

Important Files Changed

FilenameOverview
apps/sim/app/api/health/route.tsNew GET handler returning { status: 'ok', timestamp } with HTTP 200; clean, minimal, no issues.
apps/sim/app/api/health/route.test.tsFocused Vitest spec validating status code and response shape; uses correct @/ alias and @vitest-environment node directive.

Sequence Diagram

sequenceDiagram
participant Probe as Deployment Probe / Load Balancer
participant Next as Next.js App Router
participant Handler as GET /api/health
Probe->>Next: GET /api/health
Next->>Handler: route handler invoked
Handler-->>Next: Response.json({ status: "ok", timestamp })
Next-->>Probe: HTTP 200 { status: "ok", timestamp: "<ISO 8601>" }
Loading

Last reviewed commit: 0c00560

@waleedlatif1
waleedlatif1 merged commit d84cba6 into simstudioai:stagingMar 13, 2026
12 checks passed
adithyaakrishna pushed a commit to adithyaakrishna/sim that referenced this pull request Mar 20, 2026
Add a simple API health route for deployment platforms and container probes, with focused route coverage.
Co-authored-by: test <test@example.com>
Sign up for freeto 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.

2 participants

@PlaneInABottle@waleedlatif1