Skip to content

Commit

Permalink
adds support for env vars if env file is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
aristidesstaffieri committed Nov 28, 2023
1 parent 72ab461 commit f44cd65
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ export function buildConfig(config: Record<string, string>) {
});

return {
hostname: config.HOSTNAME,
mercuryBackend: config.MERCURY_BACKEND,
mercuryEmail: config.AUTH_EMAIL,
mercuryGraphQL: config.MERCURY_GRAPHQL,
mercuryKey: config.MERCURY_KEY,
mercuryPassword: config.AUTH_PASS,
mercuryUserId: config.MERCURY_USER_ID,
mode: config.MODE,
redisConnectionName: config.REDIS_CONNECTION_NAME,
redisPort: Number(config.REDIS_PORT),
hostname: config.HOSTNAME || process.env.HOSTNAME,
mercuryBackend: config.MERCURY_BACKEND || process.env.MERCURY_BACKEND,
mercuryEmail: config.AUTH_EMAIL || process.env.AUTH_EMAIL,
mercuryGraphQL: config.MERCURY_GRAPHQL || process.env.MERCURY_GRAPHQL,
mercuryKey: config.MERCURY_KEY || process.env.MERCURY_KEY,
mercuryPassword: config.AUTH_PASS || process.env.AUTH_PASS,
mercuryUserId: config.MERCURY_USER_ID || process.env.MERCURY_USER_ID,
mode: config.MODE || process.env.MODE,
redisConnectionName:
config.REDIS_CONNECTION_NAME || process.env.REDIS_CONNECTION_NAME,
redisPort: Number(config.REDIS_PORT) || Number(process.env.REDIS_PORT),
};
}

Expand Down

0 comments on commit f44cd65

Please sign in to comment.