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

main
ts 13 lines 490 Bytes
Raw
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 }