fix: cors

feat-display-remote-workers
Meng Zhang 2023-11-22 07:01:15 +08:00
parent 298ed2097a
commit 5782ab8a77
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import { GraphQLClient, Variables, RequestOptions } from 'graphql-request'
export const graphQLClient = new GraphQLClient( export const graphQLClient = new GraphQLClient(
`${process.env.NEXT_PUBLIC_TABBY_SERVER_URL ?? ''}/graphql`, `${process.env.NEXT_PUBLIC_TABBY_SERVER_URL ?? ''}/graphql`,
{ {
credentials: 'include', // credentials: 'include',
mode: 'cors' mode: 'cors'
} }
) )

View File

@ -46,11 +46,11 @@ pub async fn attach_webserver(
"/graphql", "/graphql",
routing::post(graphql::<Arc<Schema>>).with_state(ctx.clone()), routing::post(graphql::<Arc<Schema>>).with_state(ctx.clone()),
) )
.route("/graphql", routing::get(playground("/graphql", None)))
.layer(Extension(schema)) .layer(Extension(schema))
.route("/hub", routing::get(ws_handler).with_state(ctx.clone())); .route("/hub", routing::get(ws_handler).with_state(ctx.clone()));
let ui = ui let ui = ui
.route("/graphql", routing::get(playground("/graphql", None)))
.route("/graphiql", routing::get(graphiql("/graphql", None))) .route("/graphiql", routing::get(graphiql("/graphql", None)))
.fallback(ui::handler); .fallback(ui::handler);