I am using Windows machine where i have elixir project. I have env.bat file where all the environment variables are set. While running the elixir project in local, environment variables are not getting retrieved.
I have tried changing env.bat to .env and having runtime.exs but that is for prod
env.bat file set ENABLE_XXX=true
in config.exs config :app, enable: System.get_env("ENABLE_XXX")
in modulehost = Application.get_env(:app, :enable)
start servermix phx.server
when access the API call it is showing as nil. how to access enviornment variables in runtime on windows?
Use
System.get_env("ENABLE_XXX")
from the module, or set it up up inconfig/runtime.exs
.