livebook/lib/livebook_web/plugs/configured_plug.ex
2023-09-21 12:28:45 +02:00

16 lines
323 B
Elixir

defmodule LivebookWeb.ConfiguredPlug do
# Runs plugs configured for the :livebook application
@behaviour Plug
@impl true
def init(opts), do: opts
@impl true
def call(conn, _opts) do
case Application.fetch_env!(:livebook, :plugs) do
[] -> conn
plugs -> Plug.run(conn, plugs)
end
end
end