The best way to control Claude Code, Codex and more from any computer or phone

main
ts 17 lines 637 Bytes
Raw
1 // An ordinary nitro API route. `event.context.cloudflare` is the
2 // cloudflare_module preset's runtime contract: `{ request, env, context }`
3 // plus `event.context.cf` (the request's cf object).
4 export default defineEventHandler((event) => {
5 const cloudflare = event.context.cloudflare as
6 | {
7 env?: Record<string, unknown>;
8 context?: { waitUntil?: unknown };
9 }
10 | undefined;
11 return {
12 marker: "api-route-ok",
13 secret:
14 typeof cloudflare?.env?.FIXTURE_SECRET === "string" ? cloudflare.env.FIXTURE_SECRET : null,
15 hasWaitUntil: typeof cloudflare?.context?.waitUntil === "function",
16 };
17 });