Does conform work without release?
Is it possible to use conform like described in the docs when using mix phx.server (using phoenix) or iex -S mix or with mix test?
I tried iex and test but both didn't seem to work. In both cases the value from config.exs was used when fetching the property with Application.get_env().
So is this lib only intended to use in conjunction with destillery or can it also be used in development / testing environments without a release?
I like to know as well if there is a way to use conform outside of releases. To have a single way to configure our application would be nice!
Let me share what I have found so far. Both Elixir as well as Ecto has implemented init callback. For example Ecto repo definition can now looks like:
defmodule MyApp.Repo do
use Ecto.Repo, otp_app: :my_app
def init(_, config) do
{:ok, Keyword.put(config, :url, System.get_env("DATABASE_URL"))}
end
end
So this could be on one of places, where one can extract app level configuration from conform and shove it back to appconfig. But to be honest, I am still not really sure, if this is the right approach.
Quite interesting thread at elixir-forum - https://elixirforum.com/t/always-use-releases/4573/18
This is something I think should be put on the main documentation. It seems it doesn't say anywhere that conform doesn't work out of the box with mix run --no-halt.