Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need changes due to CORS blocked #5

Open
PatrickChoDev opened this issue Jan 30, 2025 · 1 comment
Open

Need changes due to CORS blocked #5

PatrickChoDev opened this issue Jan 30, 2025 · 1 comment
Assignees

Comments

@PatrickChoDev
Copy link

PatrickChoDev commented Jan 30, 2025

app.Use(cors.New(cors.Config{
AllowOrigins: "http://localhost:3000", // Allowed origin
AllowMethods: "GET,POST,PUT,PATCH,DELETE,OPTIONS", // Allow all necessary HTTP methods
AllowHeaders: "Origin, Content-Type, Accept, Authorization", // Include Authorization and other headers
AllowCredentials: true, // Allow credentials to be included
}))

@bunnybunbun37204
Copy link
Member

fixed

	app.Use(cors.New(cors.Config{
		AllowOrigins:     utils.GetEnv("CLIENT_BASE_URL", "http://localhost:3000"), // Allowed origin
		AllowMethods:     "GET,POST,PUT,PATCH,DELETE,OPTIONS", // Allow all necessary HTTP methods
		AllowHeaders:     "Origin, Content-Type, Accept, Authorization", // Include Authorization and other headers
		AllowCredentials: true, // Allow credentials to be included
	}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants