summaryrefslogtreecommitdiff
path: root/lib/router.ml
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-07-16 22:37:58 +0700
committerpolwex <polwex@sortug.com>2025-07-16 22:37:58 +0700
commitd43776f556ba63d2e6f48fdf6f94ba3b8f1e0199 (patch)
tree8a91e8d9432dbc0ec64a5a3e1a1f0d8e9e3a93a3 /lib/router.ml
parentf22bdc35a3555e1a09f33b1ebbcb01f537a9b292 (diff)
m
Diffstat (limited to 'lib/router.ml')
-rw-r--r--lib/router.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/router.ml b/lib/router.ml
index 56a297c..a29a8bc 100644
--- a/lib/router.ml
+++ b/lib/router.ml
@@ -32,7 +32,7 @@ let static (path : Parts.t) (_db : Handler.pool) (_req : Request.t)
| Ok body ->
(match Body.to_string body with
| Error _ -> Ok (Response.create `Internal_server_error)
- | Ok str -> Ok (Response.of_string ~body:str Status.(`Accepted)))
+ | Ok str -> Ok (Response.of_string ~body:str `Accepted))
;;
(* match Parts.wildcard_match path with *)
@@ -40,7 +40,9 @@ let static (path : Parts.t) (_db : Handler.pool) (_req : Request.t)
(* | _ -> Ok (Response.of_string ~body:"" Status.(`Accepted)) *)
(* Define all routes in the application *)
-let routes : (Handler.pool -> Request.t -> (Response.t, Caqti_error.t) result) route list R.t =
+let routes
+ : (Handler.pool -> Request.t -> (Response.t, Caqti_error.t) result) route list R.t
+ =
(* Use fold_left to build up a map of routes *)
List.fold_left
(* For each (verb, route) pair, add the route to the map under that verb *)