https://github.com/jshmrtn/plug-dynamic
:unlock: Allows registration of every Plug with dynamic configuration.
https://github.com/jshmrtn/plug-dynamic
elixir phoenix-framework plug
Last synced: about 1 year ago
JSON representation
:unlock: Allows registration of every Plug with dynamic configuration.
- Host: GitHub
- URL: https://github.com/jshmrtn/plug-dynamic
- Owner: jshmrtn
- License: mit
- Created: 2018-09-12T14:04:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-12T15:29:08.000Z (almost 8 years ago)
- Last Synced: 2025-05-08T06:28:42.633Z (about 1 year ago)
- Topics: elixir, phoenix-framework, plug
- Language: Elixir
- Size: 10.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Plug Dynamic
[](https://raw.githubusercontent.com/jshmrtn/plug-dynamic/master/LICENSE)
[](https://travis-ci.com/jshmrtn/plug-dynamic)
[](https://hex.pm/packages/plug_dynamic)
[](https://coveralls.io/github/jshmrtn/plug-dynamic?branch=master)
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`:
```elixir
def deps do
[
{:plug_dynamic, "~> 1.0"}
]
end
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). The docs can be found at
[https://hexdocs.pm/plug_dynamic](https://hexdocs.pm/plug_dynamic).
## Usage Example
For detailed instructions check the [documentation](https://hexdocs.pm/plug_dynamic).
```elixir
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
```