From 90ea298a61f547beb3de0058d341d63f0f7353c1 Mon Sep 17 00:00:00 2001 From: hubert Date: Thu, 22 Jul 2021 13:33:49 +0200 Subject: [PATCH] prepare generalisation git_main --- src/main.rs | 5 ++++- src/web/repo.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2edcd5e..1203bb0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -172,7 +172,10 @@ async fn main() -> std::io::Result<()> { .service(hello_test) .service(index) .service(askama) - .service(repo::git_main) + .service( + webx::resource("/git/{owner}/{repo}.git") + .route(webx::get().to(repo::git_main)) + ) .service(hello_session) .service(chunk) //.service(git_proto) diff --git a/src/web/repo.rs b/src/web/repo.rs index 1414b5d..8c872e9 100644 --- a/src/web/repo.rs +++ b/src/web/repo.rs @@ -55,7 +55,7 @@ pub struct GitWebQ { branch: Option, } -#[get("/git/{owner}/{repo}.git")] +//#[get("/git/{owner}/{repo}.git")] pub async fn git_main( web::Path((ownername, reponame)): web::Path<(String, String)>, web::Query(GitWebQ{commit : commitnameopt, path : pathopt, branch : branchopt}) : web::Query,