application.ex 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. defmodule Fourletters.Application do
  2. # See https://hexdocs.pm/elixir/Application.html
  3. # for more information on OTP Applications
  4. @moduledoc false
  5. use Application
  6. def start(_type, _args) do
  7. children = [
  8. # Start the Telemetry supervisor
  9. FourlettersWeb.Telemetry,
  10. # Start the letter troll
  11. {Fourletters.Troll, name: Fourletters.Troll},
  12. # Start the PubSub system
  13. {Phoenix.PubSub, name: Fourletters.PubSub},
  14. # Start the Endpoint (http/https)
  15. FourlettersWeb.Endpoint
  16. # Start a worker by calling: Fourletters.Worker.start_link(arg)
  17. # {Fourletters.Worker, arg}
  18. ]
  19. # See https://hexdocs.pm/elixir/Supervisor.html
  20. # for other strategies and supported options
  21. opts = [strategy: :one_for_one, name: Fourletters.Supervisor]
  22. Supervisor.start_link(children, opts)
  23. end
  24. # Tell Phoenix to update the endpoint configuration
  25. # whenever the application is updated.
  26. def config_change(changed, _new, removed) do
  27. FourlettersWeb.Endpoint.config_change(changed, removed)
  28. :ok
  29. end
  30. end