Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

754 B
Raw Blame
/**
 * Process-alive probe. Distinct from /healthz (lifecycle readiness).
 * Does not inspect the database, catalog, or providers. Still runs on the
 * main Node event loop — busy ≠ dead; prefer TCP liveness under stall.
 */
export const dynamic = "force-dynamic";

const LIVE_BODY = "ok\n";

function createLiveResponse(method: "GET" | "HEAD"): Response {
  return new Response(method === "HEAD" ? null : LIVE_BODY, {
    status: 200,
    headers: {
      "Cache-Control": "no-store",
      "Content-Length": String(LIVE_BODY.length),
      "Content-Type": "text/plain; charset=utf-8",
    },
  });
}

export function GET(): Response {
  return createLiveResponse("GET");
}

export function HEAD(): Response {
  return createLiveResponse("HEAD");
}