fix: Modify JSON response for 429 errors
@@ -39,7 +39,15 @@ func Run() {
app.Use(compress.New())
app.Use(etag.New())
app.Use(favicon.New())
- app.Use(limiter.New(limiter.Config{Max: 50}))
+ app.Use(limiter.New(limiter.Config{
+ Max: 100,
+ LimitReached: func(c *fiber.Ctx) error {
+ return c.Status(fiber.StatusTooManyRequests).JSON(&fiber.Map{
+ "status": "fail",
+ "message": "You have requested too many in a single time-frame! Please wait another minute!",
+ })
+ },
+ }))
app.Use(logger.New())
app.Use(recover.New())
app.Use(requestid.New())
