use axum::{http::StatusCode, response::IntoResponse, Form}; #[derive(serde::Deserialize)] pub(crate) struct IndexData { username: String, } pub(crate) 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, {}!\n", &username)) } #[derive(serde::Deserialize)] pub(crate) struct Subscription { _email: String, _name: String, } pub(crate) async fn subscribe(_payload: Form) -> impl IntoResponse { (StatusCode::OK, ()) }