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 | "use server"; |
| 2 | |
| 3 | import { readMessage } from "./env.ts"; |
| 4 | |
| 5 | /** |
| 6 | * A React server function driven by `useActionState` in a client component: |
| 7 | * the form submission POSTs to the RSC endpoint and executes here, inside the |
| 8 | * worker runtime — reading the `MESSAGE` binding proves it. |
| 9 | */ |
| 10 | export async function greet(_previous: string, formData: FormData): Promise<string> { |
| 11 | const name = String(formData.get("name") ?? "anonymous"); |
| 12 | return `Hello, ${name}! MESSAGE=${await readMessage()}`; |
| 13 | } |