#[cfg(feature = "ssr")] #[tokio::main] async fn main() { use axum::Router; use axum::routing::get; use blog::app::*; use blog::feed::atom_feed; use leptos::logging::log; use leptos::prelude::*; use leptos_axum::{LeptosRoutes, generate_route_list}; let conf = get_configuration(None).unwrap(); let leptos_options = conf.leptos_options; let routes = generate_route_list(App); let app = Router::new() .route("/atom.xml", get(atom_feed)) .leptos_routes(&leptos_options, routes, { let leptos_options = leptos_options.clone(); move || shell(leptos_options.clone()) }) .fallback(leptos_axum::file_and_error_handler(shell)) .with_state(leptos_options); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); log!("listening on {}", listener.local_addr().unwrap()); axum::serve(listener, app.into_make_service()) .await .unwrap(); } #[cfg(not(feature = "ssr"))] pub fn main() { // No client-side main function // See lib.rs for hydration function instead }