Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - whatyouhide/plug_heartbeat: A plug for responding to heartbeat requests.

A plug for responding to heartbeat requests. Contribute to whatyouhide/plug_heartbeat development by creating an account on GitHub.

Visit SiteGitHub - whatyouhide/plug_heartbeat: A plug for responding to heartbeat requests.

GitHub - whatyouhide/plug_heartbeat: A plug for responding to heartbeat requests.

A plug for responding to heartbeat requests. Contribute to whatyouhide/plug_heartbeat development by creating an account on GitHub.

Powered by 0x5a.live 💗

PlugHeartbeat

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, "~> 1.0"}]
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.

Elixir Resources

are all listed below.

Resources

listed to get explored on!!

Made with ❤️

to provide different kinds of informations and resources.