🔊 Use logger middleware in health route, I think?

This commit is contained in:
Maxim Lebedev 2022-01-12 22:53:00 +05:00
parent dd5484b7d7
commit 257759e47c
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"github.com/fasthttp/router"
http "github.com/valyala/fasthttp"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/common"
)
@ -14,7 +15,11 @@ func NewRequestHandler() *RequestHandler {
}
func (h *RequestHandler) Register(r *router.Router) {
r.GET("/health", h.read)
chain := middleware.Chain{
middleware.LogFmt(),
}
r.GET("/health", chain.RequestHandler(h.read))
}
func (h *RequestHandler) read(ctx *http.RequestCtx) {