auth/internal/health/delivery/http/health_http.go

28 lines
571 B
Go
Raw Normal View History

package http
import (
"github.com/fasthttp/router"
http "github.com/valyala/fasthttp"
2021-11-14 21:15:28 +00:00
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/toby3d/auth/internal/common"
)
type RequestHandler struct{}
func NewRequestHandler() *RequestHandler {
2021-12-28 23:08:50 +00:00
return &RequestHandler{}
}
func (h *RequestHandler) Register(r *router.Router) {
chain := middleware.Chain{
middleware.LogFmt(),
}
r.GET("/health", chain.RequestHandler(h.read))
}
2021-12-28 23:08:50 +00:00
func (h *RequestHandler) read(ctx *http.RequestCtx) {
ctx.SuccessString(common.MIMEApplicationJSONCharsetUTF8, `{"ok": true}`)
}