We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I placed section
unless Mix.env() == :prod do Envy.auto_load() end
to lib/app/application.ex and it does not work (I have System.get_env("DB_USER", "postgres") in config/dev.exs)
lib/app/application.ex
System.get_env("DB_USER", "postgres")
config/dev.exs
The text was updated successfully, but these errors were encountered:
.env
POSTGRES_USER=foobar
application.ex
def start
def start(_type, _args) do # ... unless Mix.env() == :prod do Envy.load([".env"]) end # ... end
<%= System.get_env("POSTGRES_USER") %>
It works on mine with
Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe] [dtrace] Elixir 1.10.4 (compiled with Erlang/OTP 23) Phoenix Framework 1.5.4
Sorry, something went wrong.
What about setting env vars in config.exs? Pretty sure config gets run before application start, so the env variables aren't set yet.
In our codebase, we have Envy.load([".env"]) at the top of config files that require env vars from .env.
Envy.load([".env"])
No branches or pull requests
I placed section
to
lib/app/application.ex
and it does not work (I haveSystem.get_env("DB_USER", "postgres")
inconfig/dev.exs
)The text was updated successfully, but these errors were encountered: