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() {
router := gin.Default()
router.Use(cors.New(cors.Config{
AllowOrigins: []string{"*"},
AllowMethods: []string{"*"},
AllowHeaders: []string{"*"},
AllowCredentials: true,
}))
cors_config := cors.DefaultConfig()
cors_config.AllowOrigins = []string{"*"}
router.Use(cors.New(cors_config))
file, err := os.Open(os.Getenv(CONFIG_PATH_ENV_VAR))
if err != nil {
panic(err)