📜  禁止使用 iris web 服务器删除方法 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:21.809000             🧑  作者: Mango

代码示例1
#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)