mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
30 lines
715 B
Elixir
30 lines
715 B
Elixir
defmodule TeslaMate.Application do
|
|
# See https://hexdocs.pm/elixir/Application.html
|
|
# for more information on OTP Applications
|
|
@moduledoc false
|
|
|
|
use Application
|
|
|
|
def start(_type, _args) do
|
|
children = [
|
|
TeslaMate.Repo,
|
|
TeslaMateWeb.Endpoint,
|
|
{TeslaMate.Api, auth()},
|
|
TeslaMate.Vehicles
|
|
]
|
|
|
|
Supervisor.start_link(children, strategy: :one_for_one, name: TeslaMate.Supervisor)
|
|
end
|
|
|
|
# Tell Phoenix to update the endpoint configuration
|
|
# whenever the application is updated.
|
|
def config_change(changed, _new, removed) do
|
|
TeslaMateWeb.Endpoint.config_change(changed, removed)
|
|
:ok
|
|
end
|
|
|
|
defp auth do
|
|
Application.get_env(:tesla_mate, :tesla_auth)
|
|
end
|
|
end
|