Skip to content

Commit 9d90a22

Browse files
committed
fix: bind the server explicitly with Bun.serve so Compute serves it
1 parent 7e9835d commit 9d90a22

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ const app = new Hono();
55
app.get("/", (c) => c.text("compute-e2e-happy: ok"));
66
app.get("/health", (c) => c.json({ ok: true }));
77

8-
export default {
9-
port: Number(process.env.PORT ?? 8080),
10-
fetch: app.fetch,
11-
};
8+
// Bind explicitly (like the build-runner's server.ts) so the server starts when
9+
// Compute runs this module — `export default { port, fetch }` only auto-serves
10+
// when Bun runs the file directly as the entrypoint, not through Compute's build.
11+
const port = Number(process.env.PORT ?? 8080);
12+
Bun.serve({ port, fetch: app.fetch });
13+
console.info(`compute-e2e-happy listening on :${port}`);

0 commit comments

Comments
 (0)