Skip to content

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

Notifications You must be signed in to change notification settings

StanAnsems/RouteTogglePlug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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")

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages