mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 08:49:00 +08:00
added cors
This commit is contained in:
parent
96d012a34b
commit
b6c718a536
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/posthog/posthog-go"
|
"github.com/posthog/posthog-go"
|
||||||
|
"github.com/rs/cors"
|
||||||
"github.com/soheilhy/cmux"
|
"github.com/soheilhy/cmux"
|
||||||
"go.signoz.io/query-service/druidQuery"
|
"go.signoz.io/query-service/druidQuery"
|
||||||
"go.signoz.io/query-service/godruid"
|
"go.signoz.io/query-service/godruid"
|
||||||
@ -104,14 +105,14 @@ func createHTTPServer(druidClientUrl string) *http.Server {
|
|||||||
|
|
||||||
apiHandler.RegisterRoutes(r)
|
apiHandler.RegisterRoutes(r)
|
||||||
|
|
||||||
// c := cors.New(cors.Options{
|
c := cors.New(cors.Options{
|
||||||
// AllowedOrigins: []string{"http://localhost:3000"},
|
AllowedOrigins: []string{"*"},
|
||||||
// // AllowCredentials: true,
|
// AllowCredentials: true,
|
||||||
// // AllowedMethods: []string{"GET", "DELETE", "POST", "PUT"},
|
// AllowedMethods: []string{"GET", "DELETE", "POST", "PUT"},
|
||||||
// })
|
})
|
||||||
|
|
||||||
// handler := c.Handler(r)
|
handler := c.Handler(r)
|
||||||
var handler http.Handler = r
|
// var handler http.Handler = r
|
||||||
|
|
||||||
handler = handlers.CompressHandler(handler)
|
handler = handlers.CompressHandler(handler)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user