PingPlug
A simple Elixir plug to echo message
Installation
The package can be installed as:
Add ping_plug to your list of dependencies in mix.exs:
def deps do
[{:ping_plug, "~> 0.1.0"}]
endUsage
Mount PingPlug module to your desire route.
e.g. route.ex
get "/ping", PingPlug, []
Add :ping_plug to your application dependencies.
mix.exs
def application do
[mod: {MyApp, []},
applications: [..., :ping_plug, ...]]
endEcho message can be specified by passing an optional params to PingPlug.
e.g.
get "/ping", PingPlug, [message: Mix.env]Available options
:message, Echo message.:content_type, Response content type.