Skip to content

Commit

Permalink
fix default port
Browse files Browse the repository at this point in the history
  • Loading branch information
inetol committed Aug 30, 2024
1 parent 5b6d651 commit 10b2b1c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const encodings: Record<Encoding, { extension: string; weight: number }> = {
};

const hostname = env.HOSTNAME || env.HOST || 'localhost';
const port = env.PORT || 3000;

logger.set(2);

Expand All @@ -23,7 +24,7 @@ for (const directory of staticDirectory) {
await loadMemory(directory);
}

logger.info(`Listening on http://${hostname}:${env.PORT}`);
logger.info(`Listening on http://${hostname}:${port}`);

// TODO: 103 Early Hints -> https://github.com/oven-sh/bun/issues/8690
export default {
Expand Down Expand Up @@ -88,7 +89,8 @@ export default {
headers: response.headers
});
},
hostname: hostname
hostname: hostname,
port: port
} satisfies Serve;

// TODO: Support graceful shutdown
Expand Down

0 comments on commit 10b2b1c

Please sign in to comment.