Skip to content

Commit

Permalink
add cors rules
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 1, 2023
1 parent 7b54f05 commit a845d90
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"github.com/spf13/viper"
"proxy/packages"
)
Expand All @@ -15,8 +16,14 @@ func main() {
}

app := fiber.New()
app.Static("/static", "./static")
app.Use(cors.New(cors.Config{
AllowOrigins: "*",
AllowHeaders: "*",
AllowMethods: "*",
}))

{
app.Static("/static", "./static")
packages.RegisterJsdelivr(app)
packages.RegisterFonts(app)
}
Expand Down

0 comments on commit a845d90

Please sign in to comment.