From 7c0daee1843e36c4c204c653a2ce010e4e0f98b2 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Thu, 22 Apr 2021 04:51:12 -0600 Subject: expect that trailing slash --- src/main.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index b248ae7..dd5fea0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,8 @@ struct IndexTemplate<'a> { #[async_std::main] async fn main() -> Result<()> { + tide::log::start(); + let matches = clap::App::new("gityeet") .arg(clap::Arg::with_name("root") .help("sets the directory from which repositories will be found") @@ -37,9 +39,9 @@ async fn main() -> Result<()> { let mut app = tide::with_state(Arc::new(Mutex::new(state))); app.at("/").get(index); { - let mut repo = app.at("/*repo"); + let mut repo = app.at("/*repo/"); repo.get(about); - repo.at("/tree").get(|_| async { Ok("bruh tree") }); + repo.at("tree/").get(|_| async { Ok("bruh tree") }); } app.listen(("127.0.0.1", port)).await?; Ok(()) @@ -50,14 +52,6 @@ type Request = tide::Request>>; async fn index(req: Request) -> tide::Result { let state = req.state(); let state = state.lock_arc().await; - for repo in &state.data { - println!("path: {:?}", repo.path()); - let head = repo.head(); - if let Ok(head) = head { - println!("head name: {:?}", head.name()); - println!("head shorthand: {:?}", head.shorthand()); - } - } Ok(IndexTemplate { state: state.deref() }.into()) } -- cgit v1.2.3