From d43776f556ba63d2e6f48fdf6f94ba3b8f1e0199 Mon Sep 17 00:00:00 2001 From: polwex Date: Wed, 16 Jul 2025 22:37:58 +0700 Subject: m --- lib/router.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/router.ml') 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 *) -- cgit v1.2.3