defmodule CustomerService.Application do # See https://hexdocs.pm/elixir/Application.html # for more information on OTP Applications @moduledoc false use Application @impl true def start(_type, _args) do oidcc_child = case Application.get_env(:customer_service, :zitadel) do nil -> [] cfg -> [ {Oidcc.ProviderConfiguration.Worker, %{ issuer: cfg[:issuer], name: CustomerService.ZitadelProvider }} ] end children = [ CustomerService.CommandedApp, CustomerService.Repo, CustomerService.Projectors.Customer, CustomerService.Projectors.QuickLead, CustomerServiceWeb.Telemetry, {DNSCluster, query: Application.get_env(:customer_service, :dns_cluster_query) || :ignore}, {Phoenix.PubSub, name: CustomerService.PubSub} | oidcc_child ++ [CustomerServiceWeb.Endpoint] ] opts = [strategy: :one_for_one, name: CustomerService.Supervisor] Supervisor.start_link(children, opts) end @impl true def config_change(changed, _new, removed) do CustomerServiceWeb.Endpoint.config_change(changed, removed) :ok end end