Skip to content

Commit 38fd254

Browse files
authored
Fixed checking env variables while starting app
1 parent 16dcc27 commit 38fd254

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ let applicationEnvVars = [ 'APP_ENVIROMENT', 'PORT', 'USE_MONGODB', 'USE_MYSQL'
66
let mysqlEnvVars = [ 'MYSQL_HOSTNAME', 'MYSQL_PORT', 'MYSQL_USERNAME', 'MYSQL_DATABASE', 'MYSQL_PASSWORD' ]
77
let mongoEnvVars = [ 'MONGO_HOSTNAME', 'MONGO_PORT', 'MONGO_DATABASE' ]
88

9-
if (process.env.USE_MONGODB) applicationEnvVars = [ ...applicationEnvVars, ...mongoEnvVars ]
10-
if (process.env.USE_MYSQL) applicationEnvVars = [ ...applicationEnvVars, ...mysqlEnvVars ]
9+
if (process.env.USE_MONGODB === 'true') applicationEnvVars = [ ...applicationEnvVars, ...mongoEnvVars ]
10+
if (process.env.USE_MYSQL === 'true') applicationEnvVars = [ ...applicationEnvVars, ...mysqlEnvVars ]
1111

1212
let unusedEnvVars = applicationEnvVars.filter((i) => !process.env[i])
1313

0 commit comments

Comments
 (0)