Skip to content
This repository was archived by the owner on Mar 3, 2024. It is now read-only.

Commit e52b1b0

Browse files
committed
old rate limiter added with 500 req
1 parent 209982c commit e52b1b0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

main.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import (
66
"devsoc23-backend/routes"
77
"log"
88
"os"
9+
"time"
910

1011
"github.com/getsentry/sentry-go"
1112
"github.com/gofiber/fiber/v2"
1213
"github.com/gofiber/fiber/v2/middleware/cors"
14+
"github.com/gofiber/fiber/v2/middleware/limiter"
1315
"github.com/gofiber/fiber/v2/middleware/logger"
1416
)
1517

@@ -35,10 +37,10 @@ func main() {
3537
}))
3638

3739
// Api rate limiter
38-
// app.Use(limiter.New(limiter.Config{
39-
// Max: 100,
40-
// Expiration: 30 * time.Second,
41-
// }))
40+
app.Use(limiter.New(limiter.Config{
41+
Max: 500,
42+
Expiration: 30 * time.Second,
43+
}))
4244
app.Use(logger.New())
4345

4446
handler := database.NewDatabase()

0 commit comments

Comments
 (0)