mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-06-19 07:30:58 +00:00
feat: add healthcheck (#141)
* feat: add healtcheck app Signed-off-by: rare-magma <rare-magma@posteo.eu> * feat: add healthz endpoint Signed-off-by: rare-magma <rare-magma@posteo.eu> * ci: add healthcheck directive to dockerfile Signed-off-by: rare-magma <rare-magma@posteo.eu> --------- Signed-off-by: rare-magma <rare-magma@posteo.eu>
This commit is contained in:
parent
e409176642
commit
6a2ce509c1
5 changed files with 129 additions and 11 deletions
7
main.go
7
main.go
|
@ -8,6 +8,9 @@ import (
|
|||
"os"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
healthcheck "github.com/tavsec/gin-healthcheck"
|
||||
"github.com/tavsec/gin-healthcheck/checks"
|
||||
"github.com/tavsec/gin-healthcheck/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -83,5 +86,9 @@ func main() {
|
|||
|
||||
r.GET("/proxy", routes.GetImage)
|
||||
|
||||
soPingCheck := checks.NewPingCheck("https://stackoverflow.com", "GET", 5000, nil, nil)
|
||||
sePingCheck := checks.NewPingCheck("https://stackexchange.com", "GET", 5000, nil, nil)
|
||||
healthcheck.New(r, config.DefaultConfig(), []checks.Check{soPingCheck, sePingCheck})
|
||||
|
||||
r.Run(fmt.Sprintf("%s:%s", host, port))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue