API client

API routes written with standard WHATWG Request and Response are dispatched directly inside the Cloudflare Worker at edge latency.

Interactive Endpoint Consumer

GET /api/ping

Click the button below to test client-side fetch() dispatch against the live edge worker endpoint:

Response JSON: Open Raw Endpoint ↗
// Click "Send Request" above to test the API route...

Source: src/api/ping.ts

export const GET = async (_request: Request, context: { remoteIp: string; platform?: { name: string } }) => {
  return Response.json({
    pong: true,
    platform: context.platform?.name ?? 'unknown',
  });
};

Next: Explore Server Scripts or Live Activity Stream.