add multiple cors url
This commit is contained in:
8
main.go
8
main.go
@@ -113,11 +113,15 @@ func saveImageNames() {
|
||||
func serveAPI() {
|
||||
// Create a new CORS handler
|
||||
c := cors.New(cors.Options{
|
||||
AllowedOrigins: []string{"http://localhost:4321"}, // Your frontend origin
|
||||
AllowedOrigins: []string{
|
||||
"http://localhost:4321",
|
||||
"https://siliconpin.cs1.hz.siliconpin.com",
|
||||
"https://siliconpin.com",
|
||||
},
|
||||
AllowedMethods: []string{"GET", "POST", "OPTIONS"},
|
||||
AllowedHeaders: []string{"Content-Type"},
|
||||
AllowCredentials: true,
|
||||
Debug: true, // Remove in production
|
||||
// Debug: true, // Remove in production
|
||||
})
|
||||
|
||||
// Create a new mux router
|
||||
|
||||
Reference in New Issue
Block a user