improved healthcheck
This commit is contained in:
@@ -55,7 +55,11 @@ func main() {
|
||||
e.Use(middleware.HTTPSRedirect())
|
||||
}
|
||||
|
||||
e.GET("/health", util.HealthCheck)
|
||||
e.GET("/health", func(c echo.Context) error {
|
||||
return c.Render(200, "health", Page{
|
||||
BuildNumber: util.GetBuildNumber(),
|
||||
})
|
||||
})
|
||||
|
||||
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
|
||||
@@ -2,8 +2,6 @@ package util
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func GetBuildNumber() string {
|
||||
@@ -13,7 +11,3 @@ func GetBuildNumber() string {
|
||||
func IsProd() bool {
|
||||
return len(GetBuildNumber()) > 0
|
||||
}
|
||||
|
||||
func HealthCheck(c echo.Context) error {
|
||||
return c.String(200, "OK")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user