added health endpoint

This commit is contained in:
Paul 2023-03-31 14:22:16 +02:00
parent b2ce13bed2
commit 9f8c4f4135

View File

@ -54,7 +54,12 @@ func (ws *WS) RunServer(config config.Config, templatefiles *embed.FS, staticfil
ws.e.GET("/static/*", func(c echo.Context) (err error) {
return static.GetStatic(staticfiles, c)
})
ws.e.GET("/health", func(c echo.Context) (err error) {
return c.String(http.StatusOK, "OK")
})
ws.e.HEAD("/health", func(c echo.Context) (err error) {
return c.String(http.StatusOK, "OK")
})
ws.e.Logger.Fatal(ws.e.Start(fmt.Sprintf("%s:%s", config.Host, config.Port)))
return
}