Skip to content

Commit 8973198

Browse files
authored
fix(bun): respect HOST and NITRO_HOST (#3547)
1 parent 9bf29d5 commit 8973198

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/presets/bun/runtime/bun.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const ws = import.meta._websocket
1313
// @ts-expect-error
1414
const server = Bun.serve({
1515
port: process.env.NITRO_PORT || process.env.PORT || 3000,
16+
host: process.env.NITRO_HOST || process.env.HOST,
1617
websocket: import.meta._websocket ? ws!.websocket : (undefined as any),
1718
async fetch(req: Request, server: any) {
1819
// https://crossws.unjs.io/adapters/bun
@@ -38,7 +39,7 @@ const server = Bun.serve({
3839
},
3940
});
4041

41-
console.log(`Listening on http://localhost:${server.port}...`);
42+
console.log(`Listening on ${server.url}...`);
4243

4344
// Scheduled tasks
4445
if (import.meta._tasks) {

0 commit comments

Comments
 (0)