From d97aec1586e805dec59ce5d2e45e451d71ba3af1 Mon Sep 17 00:00:00 2001 From: Alexander NeonXP Kiryukhin Date: Sat, 6 Apr 2024 20:44:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BB=D0=B8=D0=B1=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 +- go.sum | 2 ++ main.go | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9636160..b7cd7b7 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,6 @@ module go.neonxp.dev/pkg go 1.22.1 -require gitrepo.ru/neonxp/middleware v0.0.0-20240406170514-e2509238d2b7 +require gitrepo.ru/neonxp/middleware v0.0.0-20240406173909-2e050160b553 require github.com/google/uuid v1.6.0 // indirect diff --git a/go.sum b/go.sum index 2d319a5..f1e32e7 100644 --- a/go.sum +++ b/go.sum @@ -2,3 +2,5 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= gitrepo.ru/neonxp/middleware v0.0.0-20240406170514-e2509238d2b7 h1:fcaAepmyVZMDA2UllERGKEXO5u9rvyWIbk83EvV4zoU= gitrepo.ru/neonxp/middleware v0.0.0-20240406170514-e2509238d2b7/go.mod h1:5K+tNLUK80Oo/Yy5wyILIk9KjjX0X/mhzkh67aEnUmk= +gitrepo.ru/neonxp/middleware v0.0.0-20240406173909-2e050160b553 h1:U1KYhZrqBM+uvzsa4bQYZbEHxbO/5YfZqK2fBVvFfW4= +gitrepo.ru/neonxp/middleware v0.0.0-20240406173909-2e050160b553/go.mod h1:5K+tNLUK80Oo/Yy5wyILIk9KjjX0X/mhzkh67aEnUmk= diff --git a/main.go b/main.go index 0ba6106..49abeb8 100644 --- a/main.go +++ b/main.go @@ -65,9 +65,11 @@ func main() { mux.Handle("GET /static/", http.FileServerFS(staticFS)) logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{})) - h := middleware.Logger(mux, logger) - h = middleware.Recover(h, logger) - h = middleware.RequestID(h) + h := middleware.Use(mux, + middleware.Logger(logger), + middleware.Recover(logger), + middleware.RequestID, + ) srv := &http.Server{ Handler: h,