If you use functions or macros, in the end, it should be too much, but if you are looking for the “save it in one place” part, I would suggest placing it in your own namespace / module
defmodule MyApp.Configuration
def server_name do
"foo"
end
def host_name, do: "example.com"
defmacro other_config do
"some value"
end
end
, , , , , ,
defmodule MyApp.Server do
alias MyApp.Configuration, as: C
end
defmodule MyApp.Server do
import MyApp.Configuration
end