diff --git a/backend/src/main.rs b/backend/src/main.rs index 13ffa88..f829c96 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -9,7 +9,7 @@ use tower_http::trace::TraceLayer; #[derive(Deserialize, Serialize, Debug)] struct Books { - numFound: u32, + num_found: u32, } // Setup the command line interface with clap. @@ -64,7 +64,10 @@ async fn main() { async fn hello() -> impl IntoResponse { //"hello from server!" - let res = reqwest::get("https://openlibrary.org/search.json?q=the+lord+of+the+rings").await?; - let resjson = res.json::().await; + let res = reqwest::get("https://openlibrary.org/search.json?q=the+lord+of+the+rings") + .await + .expect("Unable to request"); + let resjson = res.json::().await.expect("Unable to return value"); + return Json(resjson); }