From e006f43619f8763750baf98f14ffa095f19f2b2b Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Sun, 16 Feb 2025 16:51:31 +0100 Subject: Simulation in Elm --- src/bin/web.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/bin/web.rs') 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) -> Json> { - let mut sim = Simulation::new(specs.principal, specs.i1, specs.years); +async fn api_simulate_get<'a>(Query(specs): Query) -> Json> { + let mut sim = Simulation::new(specs. principal, specs.i1, specs.years); let updates: SimUpdates = SimUpdates::default(); sim.run(updates); Json(sim) -- cgit v1.2.3