This commit is contained in:
ACoolName 2024-05-25 01:20:35 +03:00
parent e13586908a
commit a4a6703aec

View File

@ -20,12 +20,9 @@ const MONGO_URL_ENV_VAR = "MONGO_URL"
func main() { func main() {
router := gin.Default() router := gin.Default()
router.Use(cors.New(cors.Config{ cors_config := cors.DefaultConfig()
AllowOrigins: []string{"*"}, cors_config.AllowOrigins = []string{"*"}
AllowMethods: []string{"*"}, router.Use(cors.New(cors_config))
AllowHeaders: []string{"*"},
AllowCredentials: true,
}))
file, err := os.Open(os.Getenv(CONFIG_PATH_ENV_VAR)) file, err := os.Open(os.Getenv(CONFIG_PATH_ENV_VAR))
if err != nil { if err != nil {
panic(err) panic(err)