Add healthz endpoint (#296)

This commit is contained in:
Nova Kwok 2023-11-23 15:40:29 +08:00 committed by GitHub
parent 84bd4c63ed
commit cc26be0f1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

9
handler/healthz.go Normal file
View File

@ -0,0 +1,9 @@
package handler
import (
"github.com/gofiber/fiber/v2"
)
func Healthz(c *fiber.Ctx) error {
return c.SendString("WebP Server Go up and running!🥳")
}

View File

@ -85,6 +85,8 @@ func main() {
})) }))
listenAddress := config.Config.Host + ":" + config.Config.Port listenAddress := config.Config.Host + ":" + config.Config.Port
app.Get("/healthz", handler.Healthz)
app.Get("/*", handler.Convert) app.Get("/*", handler.Convert)
fmt.Println("WebP Server Go is Running on http://" + listenAddress) fmt.Println("WebP Server Go is Running on http://" + listenAddress)