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
I think it would've been great to support dotenv-like behavior in envy.
That Node library can read environment variables from either environment variables directly (like envy does) or via .env file, which is super convenient during the local development, cause we can have .env.example with some default values for the development environment.
💻 Basic example
As an example, I can provide my own pet project where I played around with envy to actually make it work as I want.
As you can see, in load_config we, first of all, try to load env variables as usual with envy and if it fails, we try to load and parse .env file into the environment variables and re-read them again. And only after that, the final fail happens. This way, I can run the project from CLion without any additional configuration and explicit default values in the code.
Of course, it could be re-implemented in a different way, if it was to become a part of envy.
The text was updated successfully, but these errors were encountered:
First of all, thanks for the fantastic library!
💡 Feature description
I think it would've been great to support dotenv-like behavior in envy.
That Node library can read environment variables from either environment variables directly (like envy does) or via
.env
file, which is super convenient during the local development, cause we can have.env.example
with some default values for the development environment.💻 Basic example
As an example, I can provide my own pet project where I played around with envy to actually make it work as I want.
As you can see, in
load_config
we, first of all, try to load env variables as usual with envy and if it fails, we try to load and parse.env
file into the environment variables and re-read them again. And only after that, the final fail happens. This way, I can run the project from CLion without any additional configuration and explicit default values in the code.Of course, it could be re-implemented in a different way, if it was to become a part of envy.
The text was updated successfully, but these errors were encountered: