fix: problem with reading environment using dotenv. #3

Merged
daball merged 1 commits from daball/nm3clol-express-app:main into main 2024-06-15 16:51:14 -04:00
Showing only changes of commit 973201e787 - Show all commits

View File

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