summaryrefslogtreecommitdiff
path: root/lib/handlers.ml
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2025-06-08 01:37:48 +0200
committerMarius Peter <marius.peter@tutanota.com>2025-06-08 01:37:48 +0200
commitef89b655e942603605d0d94837ba2407f86352bf (patch)
tree2094062f4a6cb7ea95a736815d3a05488cba9027 /lib/handlers.ml
parent0647fb79dea80219ea0b0be2b315163d9a5d3ae2 (diff)
Implement Tree and Blob views.
Getting real close to something good now!
Diffstat (limited to 'lib/handlers.ml')
-rw-r--r--lib/handlers.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/handlers.ml b/lib/handlers.ml
index 17f3ac0..21d3ea8 100644
--- a/lib/handlers.ml
+++ b/lib/handlers.ml
@@ -31,16 +31,19 @@ module Repo = struct
Views.Repo.log (repo req) commits |> Dream_html.respond
let tree_head req =
- Dream.log "Tree head";
let* tree = head_tree (repo req) in
Views.Repo.tree (repo req) tree |> Dream_html.respond
let tree_id req =
- Dream.log "Tree id";
let id = id_of_req req in
let* tree = tree_of_id (repo req) id in
Views.Repo.tree (repo req) tree |> Dream_html.respond
+ let blob_id req =
+ let id = id_of_req req in
+ let* blob = blob_of_id (repo req) id in
+ Views.Repo.blob (repo req) blob |> Dream_html.respond
+
let commit req =
let id = id_of_req req in
let* commit = commit_of_id (repo req) id in
@@ -59,6 +62,7 @@ let all_handlers =
get "/log/" log;
get "/tree/" tree_head;
get "/tree/:id" tree_id;
+ get "/blob/:id" blob_id;
get "/commit/:id" commit;
];
get "/static/**" (static "./lib/static");
Copyright 2019--2025 Marius PETER