This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
bdfr-browser/lib/bdfr_browser/application.ex

22 lines
642 B
Elixir
Raw Normal View History

2023-05-17 22:13:55 +00:00
defmodule BdfrBrowser.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
{:ok, http_ip} = :inet.parse_address(Application.fetch_env!(:bdfr_browser, :http_ip))
http_port = Application.fetch_env!(:bdfr_browser, :http_port)
children = [
{Plug.Cowboy, scheme: :http, plug: BdfrBrowser.HTTP.Plug, options: [ip: http_ip, port: http_port]},
:systemd.ready()
]
opts = [strategy: :one_for_one, name: BdfrBrowser.Supervisor]
Supervisor.start_link(children, opts)
end
end