use axum::{http::StatusCode, response::IntoResponse, Form}; #[derive(serde::Deserialize)] pub struct FormData { username: String, } pub async fn index(payload: Option>) -> impl IntoResponse { let username = payload.map_or("World !".to_string(), move |index| -> String { String::from(&(index.username)) }); (StatusCode::OK, format!("Hello, {}", &username)) }