fix: body parsing function (#670)

This commit is contained in:
Valerio Ageno
2025-03-29 11:15:45 +01:00
committed by GitHub
parent f293a1dee8
commit 53ec3ae280
8 changed files with 83 additions and 44 deletions
+12
View File
@@ -0,0 +1,12 @@
use serde::Deserialize;
use tuono_lib::Request;
#[derive(Deserialize)]
struct Payload {
data: String,
}
#[tuono_lib::api(POST)]
async fn health_check(req: Request) -> String {
req.body::<Payload>().unwrap().data
}