auth/internal/health/delivery/http/health_http.go
Maxim Lebedev 3b0ebb3690
Some checks failed
continuous-integration/drone Build is failing
🚚 Renamed module due project migration
2022-03-13 15:58:34 +05:00

28 lines
571 B
Go

package http
import (
"github.com/fasthttp/router"
http "github.com/valyala/fasthttp"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/toby3d/auth/internal/common"
)
type RequestHandler struct{}
func NewRequestHandler() *RequestHandler {
return &RequestHandler{}
}
func (h *RequestHandler) Register(r *router.Router) {
chain := middleware.Chain{
middleware.LogFmt(),
}
r.GET("/health", chain.RequestHandler(h.read))
}
func (h *RequestHandler) read(ctx *http.RequestCtx) {
ctx.SuccessString(common.MIMEApplicationJSONCharsetUTF8, `{"ok": true}`)
}