Skip to content

Commit f9d0b1a

Browse files
committed
feat: add CORS configuration
1 parent 93187f3 commit f9d0b1a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/ansrivas/fiberprometheus/v2"
88
"github.com/caarlos0/env/v6"
99
"github.com/gofiber/fiber/v2"
10+
"github.com/gofiber/fiber/v2/middleware/cors"
1011
"github.com/gofiber/fiber/v2/middleware/recover"
1112
"github.com/italia/publiccode-validator-api/internal/common"
1213
"github.com/italia/publiccode-validator-api/internal/handlers"
@@ -43,6 +44,8 @@ func Setup() *fiber.App {
4344
// Automatically recover panics in handlers
4445
app.Use(recover.New())
4546

47+
app.Use(cors.New())
48+
4649
prometheus := fiberprometheus.New(os.Args[0])
4750
prometheus.RegisterAt(app, "/metrics")
4851
app.Use(prometheus.Middleware)

0 commit comments

Comments
 (0)