Skip to content

Commit 4880a4e

Browse files
committed
feat: add option to specify host via environment variable
1 parent 2d02cac commit 4880a4e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const schema = Type.Object(
2828
AUTH_MODE: Type.Optional(
2929
Type.Enum({ static: 'static', jwt: 'jwt', none: 'none' }),
3030
),
31+
HOST: Type.String({ default: '::' }),
3132
JWT_AUDIENCE: Type.Optional(Type.String({ separator: ',' })),
3233
JWT_ISSUER: Type.Optional(Type.String()),
3334
JWKS_URL: Type.Optional(Type.String()),

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ closeWithGrace(
2323
},
2424
)
2525

26-
app.listen({ host: '0.0.0.0', port: env.get().PORT }, (err) => {
26+
app.listen({ host: env.get().HOST, port: env.get().PORT }, (err) => {
2727
if (err) {
2828
app.log.error(err)
2929
process.exit(1)

0 commit comments

Comments
 (0)