You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2019. It is now read-only.
Rejoice passes this environment variable one time into the dbModule register function as a string (as expected). I would like it to call the dbModule register function twice, once for each option object (how it behaves if the JSON is hardcoded). This would allow me to continue leveraging the simplicity of Rejoice for configuration setup rather than handling this in the dbModule.
My suggestion for a fix:
Rejoice's parseEnv function (line 110) could check if
process.env[value.slice(5)]
returns valid JSON, and if so,
JSON.parse the key value rather than keep it a string.
This sounds like it could be useful. I checked with a few members to make sure this doesn't go out of scope of its intended purpose and I think this is a reasonable change. Feel free to do a PR to add this feature and add the required test(s) to ensure it is fully covered. Thanks in advance!
I would like my configuration file to reference JSON environment variables. I don’t believe Rejoice can handle this:
"plugins": { "dbModule": "$env.jsonEnvVariable" }
where
jsonEnvVariable
is a list of db connection details as such:Rejoice passes this environment variable one time into the dbModule register function as a string (as expected). I would like it to call the dbModule register function twice, once for each option object (how it behaves if the JSON is hardcoded). This would allow me to continue leveraging the simplicity of Rejoice for configuration setup rather than handling this in the dbModule.
My suggestion for a fix:
Rejoice's parseEnv function (line 110) could check if
returns valid JSON, and if so,
JSON.parse
the key value rather than keep it a string.Something like this:
The text was updated successfully, but these errors were encountered: