sloane.sh/lib/sloane_sh/serve.ex
2024-02-17 08:09:30 -05:00

21 lines
396 B
Elixir

defmodule SloaneSH.Serve do
@moduledoc """
Task to use `Bandit` to start `SloaneSH.Serve.Plug`
"""
use Supervisor
alias __MODULE__
def start_link(ctx) do
Supervisor.start_link(__MODULE__, ctx, name: __MODULE__)
end
@impl Supervisor
def init(_ctx) do
children = [
{Bandit, plug: Serve.Plug}
]
Supervisor.init(children, strategy: :one_for_one)
end
end