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 | // Worker-in-front-of-static-site: assets are matched first |
| 2 | // (`runWorkerFirst` is unset), so this worker only receives requests no |
| 3 | // static asset answers — the API route and everything unmatched |
| 4 | // (`not_found_handling: "none"` delegates 404s here). |
| 5 | export default { |
| 6 | async fetch(request: Request) { |
| 7 | const url = new URL(request.url); |
| 8 | if (url.pathname === "/api/hello") { |
| 9 | return Response.json({ message: "Hello World", source: "worker" }); |
| 10 | } |
| 11 | return new Response("Not Found", { status: 404 }); |
| 12 | }, |
| 13 | }; |