Skip to content

Commit

Permalink
Rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
grkamil committed Sep 30, 2019
1 parent 02294e0 commit 3262603
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ func SetupRouter(db *pg.DB, explorer *core.Explorer) *gin.Engine {
router.Use(apiMiddleware(db, explorer)) // init global context

// create ip map
//ipMap := sync.Map{}
//router.Use(throttle(ipMap)) // rate limit
ipMap := sync.Map{}
// rate limit
router.Use(throttle(ipMap))

// Default handler 404
router.NoRoute(func(c *gin.Context) {
Expand Down

0 comments on commit 3262603

Please sign in to comment.