fix: move limiter after display views
This commit is contained in:
parent
bc29b63114
commit
5e62d31124
|
@ -58,12 +58,6 @@ func (s *RestServer) Start(ctx context.Context, apiPort, views string) error {
|
|||
BodyLimit: MAX_FILE_SIZE_MiB,
|
||||
})
|
||||
|
||||
s.app.Use(limiter.New(limiter.Config{
|
||||
Max: 5,
|
||||
Expiration: 30 * time.Minute,
|
||||
LimiterMiddleware: limiter.SlidingWindow{},
|
||||
}))
|
||||
|
||||
s.app.Use(cors.New(cors.Config{
|
||||
AllowMethods: "GET,POST,OPTIONS",
|
||||
AllowOrigins: "*",
|
||||
|
@ -79,6 +73,11 @@ func (s *RestServer) Start(ctx context.Context, apiPort, views string) error {
|
|||
go s.btcService.Notify(ctx, notifChan)
|
||||
go s.onNotification(ctx, notifChan)
|
||||
|
||||
s.app.Use(limiter.New(limiter.Config{
|
||||
Max: 5,
|
||||
Expiration: 30 * time.Minute,
|
||||
LimiterMiddleware: limiter.SlidingWindow{},
|
||||
}))
|
||||
s.app.Post("/order", orderHandler.Post)
|
||||
|
||||
if err := s.app.Listen(":" + apiPort); err != nil {
|
||||
|
|
Loading…
Reference in New Issue