use rocket::{get, routes, Route, State}; use rocket_dyn_templates::{context, Template}; use sqlx::SqlitePool; use crate::model::{stat::Stat, user::User}; #[get("/")] async fn index(db: &State, user: User) -> Template { let stat = Stat::get_rowed_km(db).await; Template::render("stat", context!(loggedin_user: &user, stat)) } pub fn routes() -> Vec { routes![index] } #[cfg(test)] mod test {}