New to Elixir / Phoenix, how to target run against dev, production or test config files

Hi,

I’m trying to help a friend with an Elixir / Phoenix project, I’m a vet coder, but new to both. All appears to be going well, but I’m stuck on how to target the relevant config file in the config directory.

I have a dev.exs, prod.exs, conig.exs and test.exs, each contains the relevant info for the right environment, but when I run iex -S mix phx.server how do I target which environment / config I’m running against?

Maybe this link will help you:

1 Like
$ MIX_ENV=prod mix phx.server
2 Likes

Thanks, in case anyone needs this;

$ MIX_ENV=dev mix phx.server
$ MIX_ENV=test mix phx.server
$ MIX_ENV=prod mix phx.server