Hey guys, I get a problem here
I want to use the gin for /debug/pprof and /debug/vars routing. I use gin.WrapH(http.DefaultServeMux) as the handler for prefix routing rule.
But in my code, I can not reach /debug/pprof/heap. And there is less guide in document for me.
I wonder if here are some misunderstand in my code
router.GET("/status", Status)
rg := router.Group("/debug", gin.WrapH(http.DefaultServeMux)) // here!
rg.GET("/pprof", gin.WrapH(http.DefaultServeMux))
rg.GET("/vars", gin.WrapH(http.DefaultServeMux))
Here's how I did it.
router.GET("/debug/pprof/*any", gin.WrapH(http.DefaultServeMux))
Without *any catch-all parameter, routes like /debug/pprof/heap won't match.
@hassansin that's what I did, thx bro.
closed
Most helpful comment
Here's how I did it.
Without
*anycatch-all parameter, routes like/debug/pprof/heapwon't match.