Set up vite proxy server, remove CORS hack

This commit is contained in:
sid palas
2023-01-23 17:01:37 -05:00
parent 961c90cd7b
commit dc832ac671
9 changed files with 26 additions and 61 deletions

View File

@ -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) {