Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/epomatti/gin-ping

A tiny health check library for Gin
https://github.com/epomatti/gin-ping

gin go health-check middleware

Last synced: 9 days ago
JSON representation

A tiny health check library for Gin

Awesome Lists containing this project

README

        

# GinPing

![Build](https://github.com/epomatti/gin-ping/actions/workflows/go.yml/badge.svg) [![codecov](https://codecov.io/gh/epomatti/gin-ping/branch/main/graph/badge.svg?token=FNZD2AMY6K)](https://codecov.io/gh/epomatti/gin-ping)

GinPing is a small middleware library for [Gin][1] to add health check routes.

## Quick start

To enable a default `/health` route:

```go
ginping.Add(r)
```

Example:

```go
package main

import (
"github.com/epomatti/gin-ping"
"github.com/gin-gonic/gin"
)

func main() {
r := gin.Default()
ginping.Add(r)
r.Run()
}
```

Testing locally with `curl localhost:8080/health` should return the response `OK`.

[1]: https://github.com/gin-gonic/gin