#![allow(missing_docs)] use std::{ collections::HashMap, net::{Ipv4Addr, SocketAddr}, }; use axum::{extract::Query, routing::get, Router, Server}; use html_node::{html, text, Node}; use html_node_core::pretty::Pretty; #[tokio::main] async fn main() { let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 3000)); println!("listening on {addr}..."); Server::bind(&addr) .serve(router().into_make_service()) .await .unwrap(); } fn router() -> Router { Router::new() .route("/", get(home)) .route("/about", get(about)) .route("/contact", get(contact)) .route("/greet", get(greet)) .route("/pretty", get(pretty)) } fn layout(content: Node) -> Node { const NAV_PAGES: &[(&str, &str)] = &[("/", "home"), ("/about", "about"), ("/contact", "contact")]; html! {