Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whatyouhide/plug_heartbeat
A plug for responding to heartbeat requests.
https://github.com/whatyouhide/plug_heartbeat
elixir plug
Last synced: about 1 month ago
JSON representation
A plug for responding to heartbeat requests.
- Host: GitHub
- URL: https://github.com/whatyouhide/plug_heartbeat
- Owner: whatyouhide
- License: mit
- Created: 2015-02-04T18:21:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T14:48:24.000Z (over 3 years ago)
- Last Synced: 2024-10-01T15:43:43.964Z (2 months ago)
- Topics: elixir, plug
- Language: Elixir
- Homepage: https://hexdocs.pm/plug_heartbeat
- Size: 14.6 KB
- Stars: 36
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A plug for responding to heartbeat requests. (Framework Components)
- fucking-awesome-elixir - plug_heartbeat - A plug for responding to heartbeat requests. (Framework Components)
- awesome-elixir - plug_heartbeat - A plug for responding to heartbeat requests. (Framework Components)
README
# PlugHeartbeat
![](https://github.com/whatyouhide/plug_heartbeat/workflows/CI/badge.svg)
A tiny plug for responding to heartbeat requests.
## Installation and docs
[Documentation is available on hex.pm][docs].
Add a dependency to your application's `mix.exs` file:
```elixir
defp deps do
[{:plug_heartbeat, "~> 1.0"}]
end
```then run `mix deps.get`.
## Usage
Just plug this plug (sorry) in your plug pipeline:
```elixir
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:```elixir
defmodule MyServer do
use Plug.Builder
plug PlugHeartbeat, path: "/health"
# ... rest of the pipeline
end
```That's pretty much it, but the [docs][docs] contain further details.
## License
MIT © Andrea Leopardi, see the [license file][license].
[license]: LICENSE.txt
[docs]: https://hex.pm/packages/plug_heartbeat