feat: Use CORS
This commit is contained in:
parent
6c57d63891
commit
5a5a7179e9
4
main.go
4
main.go
@ -10,9 +10,11 @@ import (
|
||||
"git.odit.services/lfk/document-server/models"
|
||||
"git.odit.services/lfk/document-server/services"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
"github.com/gofiber/fiber/v2/middleware/keyauth"
|
||||
"github.com/gofiber/swagger"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/rs/cors"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
@ -118,6 +120,8 @@ func main() {
|
||||
Prefork: config.Prod,
|
||||
})
|
||||
|
||||
app.Use(cors.New())
|
||||
|
||||
// Swagger documentation route
|
||||
app.Get("/swagger/*", swagger.HandlerDefault)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user