Skip to content

🔓 Allows registration of every Plug with dynamic configuration.

License

Notifications You must be signed in to change notification settings

jshmrtn/plug-dynamic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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