Allows registration of every Plug with dynamic configuration.
The package can be installed by adding plug_dynamic to your list of
dependencies in mix.exs:
def deps do
[
{:plug_dynamic, "~> 1.0"}
]
endDocumentation can be generated with ExDoc and published on HexDocs. The docs can be found at https://hexdocs.pm/plug_dynamic.
For detailed instructions check the documentation.
defmodule Acme.Endpoint do
use Plug.Builder
use PlugDynamic
dynamic_plug Plug.IpWhitelist.IpWhitelistEnforcer, [reevaluate: :first_usage] do
Application.fetch_env!(:acme, Plug.IpWhitelist.IpWhitelistEnforcer)
end
end