jackbpaiva
Add configs dynamic
Good morning people.
I am having a question about how I could do a function that would do an external access and then I would add this setting in the config.exs file.
config.exs
config :myapp_web, MyappWeb.Endpoint,
test: [host: MyappWeb.External.test()]
external.ex
defmodule MyappWeb.External do
def test do
response = "localhost"
response
end
end
Not found MyappWeb.External.test.
Thanks.
Marked As Solved
NobbZ
I’m not only speaking about releases, as far as I understand the “old” way to do configuration has been deprecated:
This module is deprecated. Use Config and Config.Reader instead.
While there is now Config available.
But yeah, from a quick glance, usage of those modules pretty much the same, and also its documentation says, that mix will evaluate the config on each run, meaning before actual compiling/loading/running the application takes place
Also Liked
hauleth
It will probably still not change much as some of the release configuration must be done before startup.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









