aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs14
1 files changed, 4 insertions, 10 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())
}