diff options
Diffstat (limited to 'lib/handlers.ml')
-rw-r--r-- | lib/handlers.ml | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/handlers.ml b/lib/handlers.ml index 17b9eab..a99f8ae 100644 --- a/lib/handlers.ml +++ b/lib/handlers.ml @@ -9,23 +9,22 @@ let ( let* ) m f = let root _req = Views.root () |> Dream_html.respond module Repo = struct - let repo_path req = Dream.param req "repo_name" + let repo req = Dream.param req "repo_name" let summary req = - let* branches = Git_helpers.Branch.all_branches (repo_path req) in - let* commits = Git_helpers.Commit.recent_commits (repo_path req) 10 in + let* branches = Git_helpers.Branch.all_branches (repo req) in + let* commits = Git_helpers.Commit.recent_commits (repo req) 10 in let authors = [ "John Pork"; "Sebastian Jellybean" ] in - Views.Repo.summary (repo_path req) branches commits authors - |> Dream_html.respond + Views.Repo.summary (repo req) branches commits authors |> Dream_html.respond - let refs req = Views.Repo.refs (repo_path req) |> Dream_html.respond - let log req = Views.Repo.log (repo_path req) |> Dream_html.respond - let tree req = Views.Repo.tree (repo_path req) |> Dream_html.respond + let refs req = Views.Repo.refs (repo req) |> Dream_html.respond + let log req = Views.Repo.log (repo req) |> Dream_html.respond + let tree req = Views.Repo.tree (repo req) |> Dream_html.respond let commit req = let id = match Dream.query req "id" with Some id -> id | None -> "" in - let* commit = Git_helpers.Commit.of_id (repo_path req) id in - Views.Repo.commit (repo_path req) commit |> Dream_html.respond + let* commit = Git_helpers.Commit.of_id (repo req) id in + Views.Repo.commit (repo req) commit |> Dream_html.respond end let all_handlers = |