use profiler middleware

This commit is contained in:
Daniel Ponte 2024-11-10 10:17:02 -05:00
parent 6e1640e4b4
commit e97c9ced0e

View file

@ -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())
}