add debug route

This commit is contained in:
pakintada@gmail.com 2024-02-08 19:54:12 +07:00
parent 608d0a6c20
commit 52c70662a7

View file

@ -146,6 +146,12 @@ func (s *Server) createHandler() {
json.NewEncoder(w).Encode(map[string]string{"message": fmt.Sprintf("path %s are not exits", r.RequestURI)})
})
// display all routes [DEBUG]
chi.Walk(r, func(method string, route string, handler http.Handler, middlewares ...func(http.Handler) http.Handler) error {
fmt.Println(method, " ---> ", route)
return nil
})
s.server.Handler = r
}