added root

This commit is contained in:
Andy Killorin 2024-12-07 11:19:19 -05:00
parent e2a28d43f0
commit 4288d979fc
Signed by: ank
GPG key ID: B6241CA3B552BCA4

View file

@ -52,7 +52,8 @@ async fn main() -> Result<()>{
let app: Router = Router::new()
.route("/names", get(root))
.route("/names", get(names))
.route("/", get(root))
.route("/admin", get(control))
.route("/phil", get(phil))
.route("/recent", get(recent_badge))
@ -130,7 +131,13 @@ async fn get_recent_badge(fish: Arc<Semaphore>) -> Result<u64> {
}
}
async fn root(state: State<AppState>) -> Html<String> {
async fn root() -> Html<String> {
let page = format!(r#"
<h1>JOHN</h1>
"#);
Html::from(page)
}
async fn names(state: State<AppState>) -> Html<String> {
let (last_badge, time) = *state.last_badge.read().await;
let time = time.elapsed();