Skip to content

Commit 4daac97

Browse files
wling-artpi0
authored andcommitted
fix(bun): respect HOST and NITRO_HOST (#3547)
1 parent 71cb7ae commit 4daac97

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
@@ -14,6 +14,7 @@ const ws = import.meta._websocket
1414
// @ts-expect-error
1515
const server = Bun.serve({
1616
port: process.env.NITRO_PORT || process.env.PORT || 3000,
17+
host: process.env.NITRO_HOST || process.env.HOST,
1718
websocket: import.meta._websocket ? ws!.websocket : (undefined as any),
1819
async fetch(request: Request, server: any) {
1920
// https://crossws.unjs.io/adapters/bun
@@ -30,7 +31,7 @@ const server = Bun.serve({
3031
},
3132
});
3233

33-
console.log(`Listening on http://localhost:${server.port}...`);
34+
console.log(`Listening on ${server.url}...`);
3435

3536
// Scheduled tasks
3637
if (import.meta._tasks) {

0 commit comments

Comments
 (0)