added cors

This commit is contained in:
ACoolName 2024-05-25 01:25:10 +03:00
parent a4a6703aec
commit 37bf73f336

View File

@ -21,7 +21,7 @@ const MONGO_URL_ENV_VAR = "MONGO_URL"
func main() { func main() {
router := gin.Default() router := gin.Default()
cors_config := cors.DefaultConfig() cors_config := cors.DefaultConfig()
cors_config.AllowOrigins = []string{"*"} cors_config.AllowOrigins = []string{"https://games.acooldomain.co"}
router.Use(cors.New(cors_config)) router.Use(cors.New(cors_config))
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 {