aboutsummaryrefslogtreecommitdiff
path: root/src/bin/web.rs
diff options
context:
space:
mode:
authorGuillermo Ramos2025-02-16 16:51:31 +0100
committerGuillermo Ramos2025-02-16 19:36:23 +0100
commite006f43619f8763750baf98f14ffa095f19f2b2b (patch)
treef30e5ca85f43a39dcbffb1f0d843b831d5e3bab0 /src/bin/web.rs
parent209adfe41e976919c290debbfd16cf81f5ba296e (diff)
downloadhiccup-e006f43619f8763750baf98f14ffa095f19f2b2b.tar.gz
Simulation in Elm
Diffstat (limited to 'src/bin/web.rs')
-rw-r--r--src/bin/web.rs5
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)