hello.ex 959 B

123456789101112131415161718192021222324252627282930
  1. defmodule Hello 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. import Supervisor.Spec, warn: false
  7. children = [
  8. # Start the endpoint when the application starts
  9. supervisor(Hello.Endpoint, []),
  10. # Here you could define other workers and supervisors as children
  11. # Start the Ecto repository
  12. worker(Hello.Repo, [])
  13. # worker(Hello.Worker, [arg1, arg2, arg3]),
  14. ]
  15. # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
  16. # for other strategies and supported options
  17. opts = [strategy: :one_for_one, name: Hello.Supervisor]
  18. Supervisor.start_link(children, opts)
  19. end
  20. # Tell Phoenix to update the endpoint configuration
  21. # whenever the application is updated.
  22. def config_change(changed, _new, removed) do
  23. Hello.Endpoint.config_change(changed, removed)
  24. :ok
  25. end
  26. end