// GET /api/ping — public keep-alive probe. // // Intentionally unauthenticated (see PUBLIC_EXACT in src/middleware.ts) and // intentionally trivial: the in-Space scheduler, an external cron, or an uptime // monitor hits this to generate the inbound traffic that stops Hugging Face // from pausing the Space. import { NextResponse } from "next/server"; export const dynamic = "force-dynamic"; export async function GET() { return NextResponse.json( { ok: true, pong: true, at: new Date().toISOString(), uptimeSeconds: Math.round(process.uptime()), }, { headers: { "Cache-Control": "no-store, no-cache, must-revalidate", }, } ); } export async function HEAD() { return new Response(null, { status: 200, headers: { "Cache-Control": "no-store" }, }); }