aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-22 04:51:12 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-22 04:51:12 -0600
commit7c0daee1843e36c4c204c653a2ce010e4e0f98b2 (patch)
tree8acd77ed7b159508f4242eb6a34c6a3f7c360b4f /src
parent9e17467a434482a54e480aac9edb9473bd3cf323 (diff)
downloadgityeet-7c0daee1843e36c4c204c653a2ce010e4e0f98b2.tar.gz
gityeet-7c0daee1843e36c4c204c653a2ce010e4e0f98b2.zip
expect that trailing slash
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())
}