t3-code-android-nightly/.repos/alchemy-effect/benchmark/container/contexts/microvm-bun/server.js
Julius Marminge 108e01746c
Upgrade Effect and Alchemy betas (#4643)
Prepare Relay production infrastructure for the PlanetScale PS_20 HA topology, upgrade Effect and Alchemy to compatible betas, reconcile migration state, and preserve patched MCP session termination behavior.\n\nCo-authored-by: codex <codex@users.noreply.github.com>
2026-07-27 16:21:02 +02:00

19 lines
680 B
JavaScript

// Dumbest possible bun HTTP server — the cold-start baseline. Mirrors the
// effectful Sandbox's two routes (`/echo` and a default text response) so the
// in-VM workload is identical; everything that differs in time-to-usable is
// the alchemy/Effect abstraction, not the work the server does.
const port = Number(process.env.PORT ?? 8080);
Bun.serve({
port,
hostname: "0.0.0.0",
fetch(req) {
const url = new URL(req.url);
if (url.pathname === "/echo") {
return Response.json({ message: url.searchParams.get("message") ?? "" });
}
return new Response("hello from bun microvm");
},
});
console.log(`bun microvm baseline listening on :${port}`);