I try this specific code but it keep on giving me error in
No 'Access-Control-Allow-Origin'
package main
import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func main() {
router := gin.Default()
router.Use(cors.Default())
v1 := router.Group("/api/products")
{
v1.GET("/", ListOfProducts)
v1.POST("/post",AddProduct)
}
}
The error is
My frontend is written in Vue.js and running on localhost:8000
localhost and the server is running on localhost:9000