🩺Fiber-health-check middleware support health-check forFiber⚡️ framework.
funcNew(config...Config) fiber.Handler
Frist import the midllware from Github,
go get -u github /gofiber/v2
go get -u github /aschenmaker/fiber-health-check
Then create a Fiber app withapp:= fiber.New()
.
app.Use(healthcheck.New())
app.Use(healthcheck.New(
HeaderName:"X-Custom-Header",
HeaderValue:"customValue",
ResponseCode:http.StatusTeapot,
ResponseText:"teapot",
))
// Config defines the config for middleware
typeConfigstruct{
// HeaderName defines the health check header key
//
// Optional. Default: "X-Health-Check"
HeaderNamestring
// HeaderValue defines the health check header val
//
// Optional. Default: "1"
HeaderValuestring
// ResponseCode defines the health check response code
//
// Optional. Default: http.StatusOK
ResponseCodeint
// ResponseText defines the health check response description
//
// Optional. Default: "ok"
ResponseTextstring
}