From e97c9ced0ebad57b2d90b1165cab92c855a5a63b Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Sun, 10 Nov 2024 10:17:02 -0500 Subject: [PATCH] use profiler middleware --- pkg/server/profile.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/server/profile.go b/pkg/server/profile.go index eb5787e..dcb9d6f 100644 --- a/pkg/server/profile.go +++ b/pkg/server/profile.go @@ -4,14 +4,9 @@ package server import ( - "net/http/pprof" + "github.com/go-chi/chi/v5/middleware" ) func (s *Server) installPprof() { - r := s.r - r.HandleFunc("/debug/pprof/", pprof.Index) - r.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) - r.HandleFunc("/debug/pprof/profile", pprof.Profile) - r.HandleFunc("/debug/pprof/symbol", pprof.Symbol) - r.HandleFunc("/debug/pprof/trace", pprof.Trace) + s.r.Mount("/debug", middleware.Profiler()) }