@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 07:15 UTC

main
astro 26 lines 846 Bytes
Raw
1 ---
2 // Server-handled form POST: GET renders the form; POST (same route) reads
3 // the multipart/urlencoded body server-side and re-renders with the echoed
4 // message. Direct fetch() POSTs (no Origin header) work because the user
5 // config sets `security.checkOrigin: false`.
6 let submitted: string | null = null;
7 if (Astro.request.method === "POST") {
8 const data = await Astro.request.formData();
9 submitted = data.get("message")?.toString() ?? null;
10 }
11 ---
12
13 <html lang="en">
14 <head>
15 <meta charset="utf-8" />
16 <title>Feedback</title>
17 </head>
18 <body>
19 <h1>Feedback</h1>
20 {submitted !== null && <p id="feedback-result">received: {submitted}</p>}
21 <form method="POST" action="/feedback">
22 <input id="message" name="message" type="text" />
23 <button id="submit" type="submit">Send</button>
24 </form>
25 </body>
26 </html>