Skip to content
A plug for responding to heartbeat requests.
Elixir
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
config
lib
test
.gitignore
.travis.yml
LICENSE.txt
README.md
mix.exs
mix.lock

README.md

PlugHeartbeat

Build Status

A tiny plug for responding to heartbeat requests.

Installation and docs

Documentation is available on hex.pm.

Add a dependency to your application's mix.exs file:

defp deps do
  [{:plug_heartbeat, "~> 0.1"}]
end

then run mix deps.get.

Usage

Just plug this plug (sorry) in your plug pipeline:

defmodule MyServer do
  use Plug.Builder
  plug PlugHeartbeat
  # ... rest of the pipeline
end

With this setup, all GET and HEAD requests to /heartbeat will return a 200 OK status and OK as the body. This path can be customized through the :path option:

defmodule MyServer do
  use Plug.Builder
  plug PlugHeartbeat, path: "/health"
  # ... rest of the pipeline
end

That's pretty much it, but the docs contain further details.

License

MIT © Andrea Leopardi, see the license file.

Something went wrong with that request. Please try again.