Skip to content

Commit

Permalink
chore: Update dependencies for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
audunhalland committed Mar 27, 2024
1 parent 05517c4 commit 531584e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions examples/async-graphql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ publish = false

[dependencies]
entrait = { path = "../../", features = ["unimock"] }
async-graphql = "4"
async-graphql = "7"
tokio = { version = "1", features = ["full"] }
async-trait = "0.1"
implementation = "0.1"

[dev-dependencies]
tower = "0.4"
tower-http = { version = "0.3", features = ["trace"] }
hyper = { version = "0.14", features = ["full"] }
tower-http = { version = "0.5", features = ["trace"] }
hyper = { version = "1", features = ["full"] }
serde_json = "1"
unimock = "0.6.2"
6 changes: 3 additions & 3 deletions examples/axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ publish = false

[dependencies]
entrait = { path = "../../", features = ["unimock"] }
axum = "0.6"
axum = "0.7"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
implementation = "0.1"
async-trait = "0.1"

[dev-dependencies]
tower = "0.4"
tower-http = { version = "0.3", features = ["trace"] }
hyper = { version = "0.14", features = ["full"] }
tower-http = { version = "0.5", features = ["trace"] }
hyper = { version = "1", features = ["full"] }
serde_json = "1"
unimock = "0.6.2"
12 changes: 6 additions & 6 deletions examples/axum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ mod rest {
)
.await
.unwrap();
let bytes = hyper::body::to_bytes(response.into_body()).await.unwrap();
let bytes = axum::body::to_bytes(response.into_body(), 1_000_000)
.await
.unwrap();
let foo: Foo = serde_json::from_slice(&bytes).unwrap();

assert_eq!("mocked", foo.value);
Expand All @@ -70,16 +72,14 @@ mod rest {
async fn main() {
use axum::extract::Extension;
use entrait::Impl;
use std::net::SocketAddr;

#[derive(Clone)]
struct App;

let app = Impl::new(App);
let router = rest::Routes::<Impl<App>>::router().layer(Extension(app));

axum::Server::bind(&SocketAddr::from(([127, 0, 0, 1], 3000)))
.serve(router.into_make_service())
.await
.unwrap();
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await.unwrap();

axum::serve(listener, router).await.unwrap();
}

0 comments on commit 531584e

Please sign in to comment.