How to read config variable in Phoenix / Elixir?

The get_env function is part of the Application module from the Elixir/Erlang core.

This function returns the value for a specific key in the app’s environment.
Considering your configuration, you would access the title property this way:

Application.get_env(:my, My.Endpoint)[:title]

The third parameter is for passing a default value when the config key doesn’t exist.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)