Skip to content

Commit 9ad6878

Browse files
mvanlondendarora
authored andcommitted
make host configure to support ipv6
1 parent 4a9461d commit 9ad6878

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Helpers:
7373
Set the following ENV VARS:
7474

7575
```bash
76+
PG_META_HOST="0.0.0.0"
7677
PG_META_PORT=8080
7778
PG_META_DB_HOST="postgres"
7879
PG_META_DB_NAME="postgres"

src/server/app.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
GENERATE_TYPES,
77
GENERATE_TYPES_INCLUDED_SCHEMAS,
88
PG_CONNECTION,
9+
PG_META_HOST,
910
PG_META_PORT,
1011
PG_META_REQ_HEADER,
1112
} from './constants'
@@ -106,11 +107,11 @@ if (EXPORT_DOCS) {
106107
})()
107108
} else {
108109
app.ready(() => {
109-
app.listen(PG_META_PORT, '0.0.0.0', () => {
110+
app.listen(PG_META_PORT, PG_META_HOST, () => {
110111
app.log.info(`App started on port ${PG_META_PORT}`)
111112
const adminApp = buildAdminApp({ logger })
112113
const adminPort = PG_META_PORT + 1
113-
adminApp.listen(adminPort, '0.0.0.0', () => {
114+
adminApp.listen(adminPort, PG_META_HOST, () => {
114115
adminApp.log.info(`Admin App started on port ${adminPort}`)
115116
})
116117
})

src/server/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export const PG_META_HOST = process.env.PG_META_HOST || '0.0.0.0'
12
export const PG_META_PORT = Number(process.env.PG_META_PORT || 1337)
23
export const CRYPTO_KEY = process.env.CRYPTO_KEY || 'SAMPLE_KEY'
34

0 commit comments

Comments
 (0)