Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
linhpn99 committed Jul 28, 2024
1 parent 578348a commit d6b2880
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/httprate"
"github.com/peterbourgon/ff/v3/ffcli"
"github.com/rs/cors"
"go.uber.org/zap"

"github.com/gnolang/tx-indexer/client"
Expand Down Expand Up @@ -169,17 +168,6 @@ func (c *startCfg) exec(ctx context.Context) error {

mux := chi.NewMux()

// Tạo middleware CORS
corsMiddleware := cors.New(cors.Options{
AllowedOrigins: []string{"*"},
AllowedMethods: []string{"GET", "POST", "OPTIONS"},
AllowedHeaders: []string{"Content-Type", "Authorization"},
AllowCredentials: true,
})

// Áp dụng middleware CORS
mux.Use(corsMiddleware.Handler)

if c.rateLimit != 0 {
logger.Info("rate-limit set", zap.Int("rate-limit", c.rateLimit))
mux.Use(httprate.Limit(
Expand Down

0 comments on commit d6b2880

Please sign in to comment.