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,