#![allow(unused)] use axum::extract::{Path, Query}; use axum::http::{Method, Uri}; use axum::response::{Html, IntoResponse, Response}; use axum::routing::{get, get_service, post, IntoMakeService}; use axum::Server; use axum::{middleware, Json, Router}; use hyper::server::conn::AddrIncoming; use serde::Deserialize; use serde_json::{json, Value}; use std::net::SocketAddr; use std::net::TcpListener; pub type App = Server>; #[derive(Deserialize)] struct FormData { email: String, name: String, } /// API routing fn app() -> Router { Router::new() .route("/health_check", get(|| async {})) .route("/subscriptions", post(|| async {})) } /// Start the server pub fn run(listener: TcpListener) -> hyper::Result { let app = app(); let server = Server::from_tcp(listener)?.serve(app.into_make_service()); Ok(server) }