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

main
tsx 19 lines 860 Bytes
Raw
1 // TOP-LEVEL `cloudflare:workers` import in a statically rendered page: the
2 // SSG step of `waku build` imports this module while prerendering, so the
3 // build only succeeds when SSG runs inside workerd (the cloudflare vite
4 // plugin's preview mode serving the freshly built worker). In Node, loading
5 // the `cloudflare:` scheme throws ERR_UNSUPPORTED_ESM_URL_SCHEME.
6 import { env } from "cloudflare:workers";
7
8 export default async function SsgEnvPage() {
9 return (
10 <div>
11 <div data-testid="ssg-env-marker">SSG_ENV_MARKER</div>
12 <div data-testid="ssg-env-message">MESSAGE={String(env.MESSAGE ?? "unset")}</div>
13 </div>
14 );
15 }
16
17 // Static: prerendered at build time — with the binding value baked into the
18 // emitted HTML, proving the SSG render had real worker bindings.
19 export const getConfig = async () => ({ render: "static" }) as const;