Skip to content

Commit

Permalink
Merge pull request #20 from gotd/feat/echo-middewares
Browse files Browse the repository at this point in the history
feat(http): add more middlewares
  • Loading branch information
ernado authored Apr 13, 2021
2 parents 9baa151 + 648e6b3 commit eda2b54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/cockroachdb/pebble"
"github.com/google/go-github/v33/github"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/povilasv/prommod"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down Expand Up @@ -138,7 +139,11 @@ func bot(ctx context.Context, metrics Metrics, logger *zap.Logger) error {
}

e := echo.New()
e.Use(echozap.ZapLogger(logger.Named("http")))
e.Use(
middleware.Recover(),
middleware.RequestID(),
echozap.ZapLogger(logger.Named("http")),
)

bot.RegisterRoutes(e)
server := http.Server{
Expand Down

0 comments on commit eda2b54

Please sign in to comment.