Environment variable is not accessible during application boot


I’ve set APPLICATION_HOST variable in the fly.toml and trying to fetch it during application but in config/runtime.exs (Phoenix) but it fails

  APPLICATION_HOST = "myapp-stg.fly.dev"
config :my_app, MyAppWeb.Endpoint,
    url: [host: System.get_env!("APPLICATION_HOST"), ... 

However, if I hardcode that variable and the application completes the boot process, I can see it in the env output.

NVM - there is no System.get_env! :slight_smile:

1 Like