handlers: add health-check endpoints
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ac4cc4ad48
commit
31ab083f8a
@ -34,6 +34,10 @@ func (a *App) SetupRoutes() {
|
||||
// alternative:
|
||||
// e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", assets)))
|
||||
e.GET("/assets/*", echo.WrapHandler(http.StripPrefix("/assets/", assets)))
|
||||
|
||||
e.GET("/healthz", handlers.Healthz())
|
||||
e.GET("/health", handlers.Healthz())
|
||||
|
||||
e.GET("/", handlers.Index())
|
||||
e.GET("/signin", handlers.Signin())
|
||||
e.POST("/signin", handlers.SigninPost(a.db))
|
||||
|
@ -52,6 +52,12 @@ func Index() echo.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func Healthz() echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "{\"status\": \"OK\"}")
|
||||
}
|
||||
}
|
||||
|
||||
func addHeaders(c echo.Context) {
|
||||
c.Response().Writer.Header().Set("Cross-Origin-Opener-Policy", "same-origin")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user