Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 741 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 741 Bytes

RouteTogglePlug

Small Elixir cowboy plug to toggle routes based on their path by a environment variable or app config

Installation

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

def deps do
  [
    {:route_toggle_plug, git: "https://github.com/stanansems/RouteTogglePlug.git", tag: "0.1.2"}
  ]
end

Configuration

Add plug

plug RouteTogglePlug, paths: ["/docs", "/docs-json"], key: :docs_enabled

Configuration to add to config.exs

config :route_toggle_plug,
  docs_enabled: true

Configure in release.exs to use an ENV variable on runtime

config :route_toggle_plug,
  docs_enabled: System.get_env("DOCS_ENABLED")