diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/web.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/web.rs b/src/bin/web.rs index cc6b94f..86effcf 100644 --- a/src/bin/web.rs +++ b/src/bin/web.rs @@ -4,6 +4,7 @@ use serde::Deserialize; use std::fs; use axum::{ response::{Html, Json}, + extract::Query, routing::get, Router, }; @@ -19,8 +20,8 @@ struct SimSpecs { years: u32, } -async fn api_simulate_get<'a>(Json(specs): Json<SimSpecs>) -> Json<hiccup::Simulation<'a>> { - let mut sim = Simulation::new(specs.principal, specs.i1, specs.years); +async fn api_simulate_get<'a>(Query(specs): Query<SimSpecs>) -> Json<hiccup::Simulation<'a>> { + let mut sim = Simulation::new(specs. principal, specs.i1, specs.years); let updates: SimUpdates = SimUpdates::default(); sim.run(updates); Json(sim) |