2021-03-19 19:32:18 +00:00
|
|
|
defmodule Legendary.Admin.Application do
|
2020-07-24 22:10:50 +00:00
|
|
|
# See https://hexdocs.pm/elixir/Application.html
|
|
|
|
# for more information on OTP Applications
|
|
|
|
@moduledoc false
|
|
|
|
|
|
|
|
use Application
|
|
|
|
|
|
|
|
def start(_type, _args) do
|
|
|
|
children = [
|
2021-03-19 19:32:18 +00:00
|
|
|
Legendary.Admin.Repo,
|
2020-07-24 22:10:50 +00:00
|
|
|
# Start the Telemetry supervisor
|
2021-03-19 19:32:18 +00:00
|
|
|
Legendary.Admin.Telemetry,
|
2020-07-24 22:10:50 +00:00
|
|
|
# Start the Endpoint (http/https)
|
2021-03-19 19:32:18 +00:00
|
|
|
Legendary.Admin.Endpoint
|
|
|
|
# Start a worker by calling: Legendary.Admin.Worker.start_link(arg)
|
|
|
|
# {Legendary.Admin.Worker, arg}
|
2020-07-24 22:10:50 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# See https://hexdocs.pm/elixir/Supervisor.html
|
|
|
|
# for other strategies and supported options
|
2021-03-19 19:32:18 +00:00
|
|
|
opts = [strategy: :one_for_one, name: Legendary.Admin.Supervisor]
|
2020-07-24 22:10:50 +00:00
|
|
|
Supervisor.start_link(children, opts)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Tell Phoenix to update the endpoint configuration
|
|
|
|
# whenever the application is updated.
|
|
|
|
def config_change(changed, _new, removed) do
|
2021-03-19 19:32:18 +00:00
|
|
|
Legendary.Admin.Endpoint.config_change(changed, removed)
|
2020-07-24 22:10:50 +00:00
|
|
|
:ok
|
|
|
|
end
|
|
|
|
end
|