This commit is contained in:
Julian Sommer
2026-01-12 02:04:46 +00:00
parent 92fd276d34
commit c37f7ea279
+9
View File
@@ -8,6 +8,7 @@ import (
"strings"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/fiber/v2/middleware/logger"
"github.com/google/uuid"
"github.com/mulgadc/hive/hive/awsec2query"
@@ -100,6 +101,14 @@ func (gw *GatewayConfig) SetupRoutes() *fiber.App {
return nil
}
// Add CORS middleware for browser requests
app.Use(cors.New(cors.Config{
AllowOrigins: "http://localhost:3000",
AllowMethods: "GET,POST,PUT,DELETE,HEAD,OPTIONS",
AllowHeaders: "*",
AllowCredentials: true,
}))
// Add authentication middleware for all requests
app.Use(s3.SigV4AuthMiddleware)