diff options
-rw-r--r-- | src/main.rs | 14 | ||||
-rw-r--r-- | templates/index.html | 4 |
2 files changed, 6 insertions, 12 deletions
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<Arc<Mutex<State>>>; 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()) } diff --git a/templates/index.html b/templates/index.html index 302c11e..ecddb48 100644 --- a/templates/index.html +++ b/templates/index.html @@ -11,8 +11,8 @@ <h1>hi this is gityeet</h1> <ul> {% for repo in state.data %} - <li><a href="/{{ state.relative_path(repo.path()).display() }}">{{ state.relative_path(repo.path()).display() }}</a></li> + <li><a href="/{{ state.relative_path(repo.path()).display() }}/">{{ state.relative_path(repo.path()).display() }}</a></li> {% endfor %} </ul> </body> -</html>
\ No newline at end of file +</html> |