In Phoenix Framework, how can I get the current environment\'s name ?
I\'ve already tried reading env variables with System.get_env(\"MIX_ENV\")>
Now in each environment config file (e.g. prod.exs) generated by default, you'll see the environment atom being set at the last line:
config :your_app, :environment, :prod
You can then use Application.get_env(:your_app, :environment) to get it.
You can do the same in any custom environment config you create.