mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-27 08:49:35 +01:00
Merge pull request #14 from bumi/add-rate-limiter
Add default rate limiter
This commit is contained in:
2
main.go
2
main.go
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"os"
|
||||
|
||||
"github.com/bumi/lndhub.go/database"
|
||||
@@ -29,6 +30,7 @@ func main() {
|
||||
e.Validator = &lib.CustomValidator{Validator: validator.New()}
|
||||
|
||||
e.Use(middlewares.ContextDB(db))
|
||||
e.Use(middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(20)))
|
||||
//e.Use(middlewares.IsLoggedIn)
|
||||
|
||||
routes.Routes(e.Group(""))
|
||||
|
||||
Reference in New Issue
Block a user