The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import { counterNamespace, readEnv } from "../env.ts"; |
| 2 | |
| 3 | export default async function HomePage() { |
| 4 | const env = await readEnv(); |
| 5 | const counter = await counterNamespace(); |
| 6 | // SSR reads the DO at request time — proves the namespace binding resolves |
| 7 | // to the Counter class exported by the user's worker entry. |
| 8 | const count = counter ? await counter.getByName("fixture").get() : -1; |
| 9 | return ( |
| 10 | <div> |
| 11 | <div data-testid="page-marker">PAGE_MARKER</div> |
| 12 | <div data-testid="env-message">MESSAGE={String(env.MESSAGE ?? "unset")}</div> |
| 13 | <div data-testid="do-count">COUNT={count}</div> |
| 14 | </div> |
| 15 | ); |
| 16 | } |
| 17 | |
| 18 | // Dynamic so the worker must serve it at request time. |
| 19 | export const getConfig = async () => ({ render: "dynamic" }) as const; |