use crate::error_template::{AppError, ErrorTemplate}; use leptos::*; use leptos_meta::*; use leptos_router::*; use serde::{Deserialize, Serialize}; pub mod error_template; #[component] pub fn App() -> impl IntoView { // Provides context that manages stylesheets, titles, meta tags, etc. provide_meta_context(); view! { // sets the document title // content for this welcome page <Router fallback=|| { let mut outside_errors = Errors::default(); outside_errors.insert_with_default_key(AppError::NotFound); view! { <ErrorTemplate outside_errors/> }.into_view() }> <main> <Routes> <Route ssr=SsrMode::Async path="" view=HomePage/> </Routes> </main> </Router> } } #[component] fn HomePage() -> impl IntoView { view! {<h1> Hello %%name%% </h1>} }