@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, 04:45 UTC

main
js 19 lines 680 Bytes
Raw
1 // Dumbest possible bun HTTP server — the cold-start baseline. Mirrors the
2 // effectful Sandbox's two routes (`/echo` and a default text response) so the
3 // in-VM workload is identical; everything that differs in time-to-usable is
4 // the alchemy/Effect abstraction, not the work the server does.
5 const port = Number(process.env.PORT ?? 8080);
6
7 Bun.serve({
8 port,
9 hostname: "0.0.0.0",
10 fetch(req) {
11 const url = new URL(req.url);
12 if (url.pathname === "/echo") {
13 return Response.json({ message: url.searchParams.get("message") ?? "" });
14 }
15 return new Response("hello from bun microvm");
16 },
17 });
18
19 console.log(`bun microvm baseline listening on :${port}`);