Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.49 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.49 KB

Plug Dynamic

GitHub license Build Status Hex.pm Version

Coverage Status

Allows registration of every Plug with dynamic configuration.

Installation

The package can be installed by adding plug_dynamic to your list of dependencies in mix.exs:

def deps do
  [
    {:plug_dynamic, "~> 1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. The docs can be found at https://hexdocs.pm/plug_dynamic.

Usage Example

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