/
ligeron
/
msclient
Обзор
Документация
Войти
/
ligeron
/
msclient
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
app/src/lib.rs
50 строк
1 KB
Aleksandr Provotorov
add storage
10 июн 2026, 16:33
10 июн 2026, 16:33
070cb4d
Код
Авторство
О чём код?
pub mod layouts; pub mod pages; mod router; use router::AppRouter; use leptos::prelude::*; use leptos_meta::{provide_meta_context, MetaTags, Stylesheet, Title}; #[cfg(feature = "ssr")] #[derive(Clone)] pub struct AppState { pub storage: storage::Storage, } #[cfg(feature = "ssr")] impl AppState { pub async fn new(db_url: &str) -> anyhow::Result<Self> { let storage = storage::Storage::new(db_url).await?; Ok(Self { storage }) } } pub fn shell(options: LeptosOptions) -> impl IntoView { view! { <!DOCTYPE html> <html lang="ru"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <AutoReload options=options.clone() /> <HydrationScripts options islands=true /> <MetaTags /> </head> <body> <App /> </body> </html> } } #[component] pub fn App() -> impl IntoView { provide_meta_context(); view! { <Stylesheet id="leptos" href="/pkg/msclient.css" /> <Title text="Welcome to Leptos" /> <AppRouter /> } }