mirror of
https://github.com/actix/examples
synced 2025-06-28 18:00:37 +02:00
do not use with2
This commit is contained in:
@ -69,7 +69,7 @@ fn graphiql(_req: HttpRequest<AppState>) -> Result<HttpResponse, Error> {
|
||||
}
|
||||
|
||||
fn graphql(
|
||||
st: State<AppState>, data: Json<GraphQLData>,
|
||||
(st, data): (State<AppState>, Json<GraphQLData>),
|
||||
) -> FutureResponse<HttpResponse> {
|
||||
st.executor
|
||||
.send(data.0)
|
||||
@ -96,7 +96,7 @@ fn main() {
|
||||
App::with_state(AppState{executor: addr.clone()})
|
||||
// enable logger
|
||||
.middleware(middleware::Logger::default())
|
||||
.resource("/graphql", |r| r.method(http::Method::POST).with2(graphql))
|
||||
.resource("/graphql", |r| r.method(http::Method::POST).with(graphql))
|
||||
.resource("/graphiql", |r| r.method(http::Method::GET).h(graphiql))
|
||||
}).bind("127.0.0.1:8080")
|
||||
.unwrap()
|
||||
|
Reference in New Issue
Block a user