How to get value from env?

I am trying to get value from env using Application.get_env(:access_key) in development mode.

It always gave empty or nil value.

1 Like

You need to use your application name IE in order to access the value set by:

# in config.exs
config :my_app,
  foo: :bar
Application.get_env(:my_app, :foo) #=> :bar
1 Like