Cleanup code

This commit is contained in:
Nettika 2026-01-25 14:54:57 -08:00
parent 66da2274a7
commit 208cfe3608
No known key found for this signature in database

View file

@ -20,7 +20,13 @@ fn main() {
let js = include_bytes!("project-card.js"); let js = include_bytes!("project-card.js");
rouille::Response::from_data("application/javascript", js.as_ref()) rouille::Response::from_data("application/javascript", js.as_ref())
}, },
(GET) ["/projects"] => { (GET) ["/projects"] => display_projects(),
_ => rouille::Response::empty_404()
)
});
}
fn display_projects() -> rouille::Response {
let projects = db::list_all_projects().unwrap_or_default(); let projects = db::list_all_projects().unwrap_or_default();
let markup = html! { let markup = html! {
@ -48,8 +54,4 @@ fn main() {
}; };
rouille::Response::html(markup.into_string()) rouille::Response::html(markup.into_string())
},
_ => rouille::Response::empty_404()
)
});
} }