Skip to content

Commit

Permalink
feat(server): listen ipv6 host
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Sep 21, 2024
1 parent 7bc9e07 commit 50a7a61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ FROM base
COPY --from=build /app /app

# Listen on 3000
ENV HOST=0.0.0.0 PORT=3000
ENV HOST=:: PORT=3000

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
Expand Down
4 changes: 3 additions & 1 deletion packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ import { registerQuery } from './query';
const admin = registerAdmin();
const query = registerQuery();

const port = process.env.port ? +process.env.port : process.env.PORT ? +process.env.PORT : 3000;
const hostname = process.env.HOST ?? process.env.host ?? '0.0.0.0';
const port = process.env.PORT ? +process.env.PORT : process.env.port ? +process.env.port : 3000;

serve(
{
fetch: app.fetch,
hostname,
port
},
async (info) => {
Expand Down

0 comments on commit 50a7a61

Please sign in to comment.