Skip to content

How do I overwrite environment variables dynamically in a typical node environment? #457

Answered by on3iro
on3iro asked this question in Q&A
Discussion options

You must be logged in to vote

I think I've found a way:

I declare the db with let and use a closure which is called at a specific time and only then binds the actual database objects to the exported variables. This seems to work fine, as far as I can tell.
Still it would be nice to know, if there is some kind of best practices for things like this in the node world :)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cristianrgreco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant