Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit 648e6b3

Browse files
committed
feat(http): add more middlewares
1 parent 6666b15 commit 648e6b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/cockroachdb/pebble"
2020
"github.com/google/go-github/v33/github"
2121
"github.com/labstack/echo/v4"
22+
"github.com/labstack/echo/v4/middleware"
2223
"github.com/povilasv/prommod"
2324
"github.com/prometheus/client_golang/prometheus"
2425
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -138,7 +139,11 @@ func bot(ctx context.Context, metrics Metrics, logger *zap.Logger) error {
138139
}
139140

140141
e := echo.New()
141-
e.Use(echozap.ZapLogger(logger.Named("http")))
142+
e.Use(
143+
middleware.Recover(),
144+
middleware.RequestID(),
145+
echozap.ZapLogger(logger.Named("http")),
146+
)
142147

143148
bot.RegisterRoutes(e)
144149
server := http.Server{

0 commit comments

Comments
 (0)