diff --git a/docs/content/recipes/cors.md b/docs/content/recipes/cors.md index f1cdb96ca30..1c205623665 100644 --- a/docs/content/recipes/cors.md +++ b/docs/content/recipes/cors.md @@ -38,17 +38,17 @@ func main() { }).Handler) - srv := handler.NewDefaultServer(starwars.NewExecutableSchema(starwars.NewResolver())) - srv.AddTransport(&transport.Websocket{ - Upgrader: websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { - // Check against your desired domains here - return r.Host == "example.org" - }, - ReadBufferSize: 1024, - WriteBufferSize: 1024, - }, - }) + srv := handler.NewDefaultServer(starwars.NewExecutableSchema(starwars.NewResolver())) + srv.AddTransport(&transport.Websocket{ + Upgrader: websocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { + // Check against your desired domains here + return r.Host == "example.org" + }, + ReadBufferSize: 1024, + WriteBufferSize: 1024, + }, + }) router.Handle("/", playground.Handler("Starwars", "/query")) router.Handle("/query", srv)