Skip to content

Commit

Permalink
add pprof middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay committed Jun 28, 2023
1 parent 4111d9a commit 34e662e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/didip/tollbooth/v5"
"github.com/didip/tollbooth/v5/limiter"
"github.com/go-chi/chi"
chimiddleware "github.com/go-chi/chi/middleware"
"github.com/rs/cors"
"github.com/sebest/xff"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -85,6 +86,9 @@ func NewAPIWithVersion(ctx context.Context, globalConfig *conf.GlobalConfigurati
r.UseBypass(api.databaseCleanup)
}

if globalConfig.Logging.Level == "debug" {
r.chi.Mount("/debug", chimiddleware.Profiler())
}
r.Get("/health", api.HealthCheck)

r.Route("/callback", func(r *router) {
Expand Down

0 comments on commit 34e662e

Please sign in to comment.