application.ex 929 B

123456789101112131415161718192021222324252627282930
  1. defmodule Web.Application do
  2. use Application
  3. # See https://hexdocs.pm/elixir/Application.html
  4. # for more information on OTP Applications
  5. def start(_type, _args) do
  6. import Supervisor.Spec
  7. # Define workers and child supervisors to be supervised
  8. children = [
  9. # Start the endpoint when the application starts
  10. supervisor(WebWeb.Endpoint, []),
  11. # Start your own worker by calling: Web.Worker.start_link(arg1, arg2, arg3)
  12. # worker(Web.Worker, [arg1, arg2, arg3]),
  13. ]
  14. # See https://hexdocs.pm/elixir/Supervisor.html
  15. # for other strategies and supported options
  16. opts = [strategy: :one_for_one, name: Web.Supervisor]
  17. Supervisor.start_link(children, opts)
  18. end
  19. # Tell Phoenix to update the endpoint configuration
  20. # whenever the application is updated.
  21. def config_change(changed, _new, removed) do
  22. WebWeb.Endpoint.config_change(changed, removed)
  23. :ok
  24. end
  25. end