Skip to content

Commit

Permalink
feat(server): remove ratelimit middleware for development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lareii committed Sep 17, 2024
1 parent 1aa556f commit 5571d2a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/middlewares/ratelimiter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package middlewares

import (
"os"
"time"

"github.com/gofiber/fiber/v2"
Expand All @@ -21,5 +22,11 @@ func RateLimiterMiddleware(max int, expiration time.Duration) fiber.Handler {
},
}

return limiter.New(config)
if os.Getenv("MODE") == "production" {
return limiter.New(config)
} else {
return func(c *fiber.Ctx) error {
return c.Next()
}
}
}

0 comments on commit 5571d2a

Please sign in to comment.