mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
add cors
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user