📅  最后修改于: 2022-03-11 14:55:21.809000             🧑  作者: Mango
#add below code snapt to iris web-server config
# import "github.com/iris-contrib/middleware/cors"
cors := cors.New(cors.Options{
AllowedOrigins: []string{"*"},
AllowCredentials: true,
AllowedHeaders: []string{"*"},
AllowedMethods: []string{"GET", "POST", "OPTIONS", "PUT", "DELETE"},
})
app := iris.New()
app.User(cors)