Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/api/health/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Liveness probe. Reads no repo data and touches no cache, so a failed check
// means the Worker is down, not that a card render failed.
export function GET() {
return Response.json({ ok: true }, { headers: { "Cache-Control": "no-store" } });
}
12 changes: 12 additions & 0 deletions tests/health-route.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { describe, expect, it } from "vitest";
import { GET } from "../app/api/health/route";

describe("/health", () => {
it("returns a small stable JSON status", async () => {
const res = GET();
expect(res.status).toBe(200);
expect(res.headers.get("content-type")).toContain("application/json");
expect(res.headers.get("cache-control")).toBe("no-store");
expect(await res.json()).toEqual({ ok: true });
});
});
Loading