From 257759e47c36176ae5347baa311fcbea9a86f407 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Wed, 12 Jan 2022 22:53:00 +0500 Subject: [PATCH] :loud_sound: Use logger middleware in health route, I think? --- internal/health/delivery/http/health_http.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/health/delivery/http/health_http.go b/internal/health/delivery/http/health_http.go index c1a2399..e542976 100644 --- a/internal/health/delivery/http/health_http.go +++ b/internal/health/delivery/http/health_http.go @@ -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) {