VR-MEDIA / src /app /api /ping /route.ts
Zero124's picture
VR Media Server 2.0 — latest build (custom Blomp thumbnail auto-detection + full pipeline)
5c0175e
Raw History Blame Contribute Delete
863 Bytes
// 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" },
});
}