// Run by csp.test.ts in a subprocess (bundling an HTML import inside a full bun test run is unreliable): // serves apps/web/index.html the way main.ts does, as a plain Bun HTML import, and prints the document. import indexHtml from "../../../../apps/web/index.html"; const development = process.argv[2] === "dev"; const server = Bun.serve({ hostname: "127.0.0.1", port: 0, routes: { "/*": indexHtml }, development }); try { const r = await fetch(`http://127.0.0.1:${server.port}/c/sample/m1-intro`); console.log(JSON.stringify({ status: r.status, type: r.headers.get("content-type"), html: await r.text() })); } finally { server.stop(true); }