set origin to avoid cors problems

This commit is contained in:
nquidox 2025-09-14 14:13:05 +03:00
parent f07131264f
commit e051c1d17f

View file

@ -39,7 +39,7 @@ func NewRouter(deps Deps) interfaces.Router {
}
engine.Use(cors.New(cors.Config{
AllowOrigins: []string{"*"},
AllowOrigins: []string{"http://localhost:5173"},
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowHeaders: []string{"Origin", "Content-Type", "Authorization"},
ExposeHeaders: []string{"Content-Length"},