Set up vite proxy server, remove CORS hack
This commit is contained in:
@ -5,7 +5,6 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"api-golang/database"
|
||||
@ -24,18 +23,6 @@ func init() {
|
||||
func main() {
|
||||
|
||||
r := gin.Default()
|
||||
r.Use(cors.New(cors.Config{
|
||||
// AllowOrigins: []string{"http://127.0.0.1:5173/"},
|
||||
AllowMethods: []string{"GET"},
|
||||
AllowHeaders: []string{"Origin"},
|
||||
ExposeHeaders: []string{"Content-Length"},
|
||||
// AllowCredentials: true,
|
||||
AllowOriginFunc: func(origin string) bool {
|
||||
return true
|
||||
// return origin == "http://127.0.0.1:8080/"
|
||||
},
|
||||
// MaxAge: 12 * time.Hour,
|
||||
}))
|
||||
var tm time.Time
|
||||
|
||||
r.GET("/", func(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user