diff options
Diffstat (limited to 'lib/router.ml')
-rw-r--r-- | lib/router.ml | 6 |
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 *) |