Skip to content

Commit 57c6de6

Browse files
committed
Update main.go
1 parent 46d2e6b commit 57c6de6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cmd/server/main.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,15 @@ func main() {
111111
router.Use(gin.Recovery())
112112
router.Use(logger.GinLogger())
113113

114-
// Configure CORS for frontend development servers
114+
// Configure CORS – allow all origins so the Capacitor mobile app
115+
// (which runs from capacitor://localhost or https://localhost) can
116+
// reach the API alongside browser-based frontends.
115117
router.Use(cors.New(cors.Config{
116-
AllowOrigins: []string{"http://localhost:3000", "http://localhost:5173"},
118+
AllowAllOrigins: true,
117119
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
118120
AllowHeaders: []string{"Origin", "Content-Type", "Authorization", "X-Docker-Host"},
119121
ExposeHeaders: []string{"Content-Length"},
120-
AllowCredentials: true,
122+
AllowCredentials: false,
121123
MaxAge: 12 * time.Hour,
122124
}))
123125

0 commit comments

Comments
 (0)