Fork of github.com/did-method-plc/did-method-plc

Increase flexibility of paramaters accepted by DB_CREDS_JSON env var

Changed files
+2 -2
packages
server
service
+2 -2
packages/server/service/index.js
···
})
}
-
const pgUrl = ({ username, password, host, port }) => {
const enc = encodeURIComponent
-
return `postgresql://${username}:${enc(password)}@${host}:${port}/postgres`
}
main()
···
})
}
+
const pgUrl = ({ username = "postgres", password = "postgres", host = "0.0.0.0", port = "5432", database = "postgres", sslmode }) => {
const enc = encodeURIComponent
+
return `postgresql://${username}:${enc(password)}@${host}:${port}/${database}${sslmode ? `?sslmode=${enc(sslmode)}` : ''}`
}
main()