application.ex 722 B

12345678910111213141516171819202122232425
  1. defmodule Hello.Application do
  2. use Application
  3. # See http://elixir-lang.org/docs/stable/elixir/Application.html
  4. # for more information on OTP Applications
  5. def start(_type, _args) do
  6. children = [
  7. Hello.Repo,
  8. {Hello.Cache, []},
  9. HelloWeb.Endpoint
  10. ]
  11. # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
  12. # for other strategies and supported options
  13. opts = [strategy: :one_for_one, name: Hello.Supervisor]
  14. Supervisor.start_link(children, opts)
  15. end
  16. # Tell Phoenix to update the endpoint configuration
  17. # whenever the application is updated.
  18. def config_change(changed, _new, removed) do
  19. HelloWeb.Endpoint.config_change(changed, removed)
  20. :ok
  21. end
  22. end