my project uses go-gin, and I tried setting cors
When I submitted the following code,
package middleware
import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func Use() {
gin.SetMode(gin.ReleaseMode)
cors.Default()
return
}
func main() {
log.Printf("Server started")
r := gin.Default()
route.Route(r)
middleware.Use()
log.Fatal(r.Run(":8080"))
}
it was pointed out that cors did not work, and this method worked fine with the application I created before, but I do not know what the problem is with this application