Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/epomatti/gin-ping
- Owner: epomatti
- License: mit
- Created: 2023-05-07T00:29:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-07T02:53:46.000Z (over 1 year ago)
- Last Synced: 2024-11-17T00:23:28.250Z (2 months ago)
- Topics: gin, go, health-check, middleware
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
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 mainimport (
"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