MOre on env parsing for k8s
This commit is contained in:
@ -205,11 +205,15 @@ const envParser =
|
||||
)
|
||||
}
|
||||
|
||||
export function getEnv(): BackendEnv {
|
||||
interface Dict<T> {
|
||||
[key: string]: T | undefined
|
||||
}
|
||||
|
||||
export function getEnv(from: Dict<string>): BackendEnv {
|
||||
// Dotenv parses env file merging into proces.env which is then read into custom struct here.
|
||||
dotenv.config()
|
||||
|
||||
const parse = envParser(process.env)
|
||||
const parse = envParser(from)
|
||||
const pg = {
|
||||
host: parse('PG_HOST'),
|
||||
port: parseInt(parse('PG_PORT'), 10),
|
||||
|
||||
Reference in New Issue
Block a user