From 4557f6bac6fe367102bf4c19922e51f1ccba493d Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Tue, 6 Oct 2026 18:39:46 +0000 Subject: [PATCH] ops: add public GET /api/health for status.profullstack.com Returns {"status":"ok"} with Cache-Control: no-store (no database in this app). Middleware lets the path past the crawl gateway. Co-Authored-By: Claude Opus 5.5 --- apps/web/app/api/health/route.ts | 9 +++++++++ apps/web/middleware.ts | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 apps/web/app/api/health/route.ts diff --git a/apps/web/app/api/health/route.ts b/apps/web/app/api/health/route.ts new file mode 100644 index 0000000..db98cad --- /dev/null +++ b/apps/web/app/api/health/route.ts @@ -0,0 +1,9 @@ +import { NextResponse } from 'next/server' + +// Rendered per request: a static answer would stay "ok" after the server died. +export const dynamic = 'force-dynamic' + +/** Public liveness check for status.profullstack.com. diskpush has no database. */ +export function GET() { + return NextResponse.json({ status: 'ok' }, { headers: { 'Cache-Control': 'no-store' } }) +} diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index ef2ea76..52b4540 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -2,6 +2,8 @@ import { gate } from "@/lib/crawl-gateway"; import { NextResponse, type NextRequest } from "next/server"; export async function middleware(request: NextRequest) { + // The status page's health probe skips the crawl gateway. + if (request.nextUrl.pathname === "/api/health") return NextResponse.next(); // Crawl gateway first: AI training crawlers get 402 Payment Required (or the // sales page at /crawl) unless they present a paid pass. People, Googlebot // and retrieval crawlers fall through to everything below.