BeacoHealthPublic
Phoenix live code reload - how to set it up?
I want to auto compile/reload/hotswap the Elixir server side code whenever a file changes. For example, reload the controller, or reload the app inside the business logic/contexts section. How do you setup the config.
Here is how I have setup the config in the dev.exs section inside the config folder:
config :discuss, DiscussWeb.Endpoint,
reloadable_compilers: [:gettext, :phoenix, :elixir],
reloadable_apps: [:ui, :backend]
of course, if I change the code inside one of the controllers, it doesn’t work. How do you do this?
Most Liked
NobbZ
The hotcode reloader is meant for development only. It only watches source files in the project directory, nothing else.
In production there is usually no need to watch sources, as you usually do not replace single source files, but the application as a whole.
If though those files are some data files, then I’m not sure why you want to reload a controller…
Usually there are better means of communication inside the application or with external applications than the local file system.
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
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








