fix: move limiter after display views

master
Urko. 2 months ago
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…
Cancel
Save