fix: problem with reading environment using dotenv.

This commit is contained in:
David Ball 2024-06-15 16:50:37 -04:00
parent 9cb16680f9
commit 973201e787

View File

@ -5,8 +5,9 @@ const dotenv = require('dotenv');
const dotenvExpand = require('dotenv-expand');
const process = require('process');
let env = dotenv.config();
dotenvExpand.expand(env);
const env = {};
let dotEnvConfig = dotenv.config({ processEnv: env });
dotEnvConfig = dotenvExpand.expand({ parsed: env, processEnv: env });
const getAppHttpHost = () => env.APP_HTTP_HOST||'nm3clol-express-app';
const getAppHttpPort = () => process.env.PORT||env.APP_HTTP_PORT||3000;