From e1bc08ed2b35a9b9faf76fab8316aec4224782cb Mon Sep 17 00:00:00 2001 From: polwex Date: Fri, 18 Jul 2025 18:54:42 +0700 Subject: mmm --- lib/router.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/router.ml b/lib/router.ml index a29a8bc..c3b4af2 100644 --- a/lib/router.ml +++ b/lib/router.ml @@ -27,6 +27,7 @@ let static (path : Parts.t) (_db : Handler.pool) (_req : Request.t) : (Response.t, Caqti_error.t) result = let pat = Parts.wildcard_match path in + Logs.info (fun d -> d "static path %S\n" pat); match Body.sendfile pat with | Error _ -> Ok (Response.create `Not_found) | Ok body -> @@ -56,7 +57,8 @@ let routes (* nil - end of path (no more segments) *) (* @--> - binds the route pattern to the handler function *) (* Handler.get_posts - the function that handles this route *) - (* ; `GET, (s "assets" / wildcard) @--> static *) + (* NOTE this took fucking forever lol *) + ; `GET, (s "assets" /? wildcard) @--> static ; `GET, (s "posts" / int /? nil) @--> Handler.get_post (* / int - captures an integer parameter (post ID) *) ; `GET, (s "comments" / int /? nil) @--> Handler.get_comment -- cgit v1.2.3