add multiple cors url
parent
e03e883e3a
commit
5b88db84ae
8
main.go
8
main.go
|
@ -113,11 +113,15 @@ func saveImageNames() {
|
||||||
func serveAPI() {
|
func serveAPI() {
|
||||||
// Create a new CORS handler
|
// Create a new CORS handler
|
||||||
c := cors.New(cors.Options{
|
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"},
|
AllowedMethods: []string{"GET", "POST", "OPTIONS"},
|
||||||
AllowedHeaders: []string{"Content-Type"},
|
AllowedHeaders: []string{"Content-Type"},
|
||||||
AllowCredentials: true,
|
AllowCredentials: true,
|
||||||
Debug: true, // Remove in production
|
// Debug: true, // Remove in production
|
||||||
})
|
})
|
||||||
|
|
||||||
// Create a new mux router
|
// Create a new mux router
|
||||||
|
|
Loading…
Reference in New Issue