Open penggy opened 6 years ago
r := gin.Default()
r.Use(gin.Logger())
r.Use(gin.Recovery())
r.Use(cors.New(cors.Config{
AllowOrigins: []string{"*"},
AllowMethods: []string{"GET", "POST", "PUT"},
AllowHeaders: []string{"Origin", "Content-Length", "Content-Type", "Authorization"},
AllowCredentials: true,
//AllowAllOrigins: true,
MaxAge: 12 * time.Hour,
}))
ui := r.Group("/")
ui.StaticFS("/", http.Dir("./static"))
How to use static middleware and cors middleware together?