Download src/app/api/ping/route.ts from Zero124/VR-MEDIA: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/Zero124/VR-MEDIA/resolve/main/src/app/api/ping/route.ts
- Command line
-
hf download hf://spaces/Zero124/VR-MEDIA/src/app/api/ping/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/Zero124/VR-MEDIA/resolve/main/src/app/api/ping/route.ts
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" }, | |
| }); | |
| } | |