lwt request_handler

This commit is contained in:
swrup 2025-11-06 14:30:48 +01:00
parent bd44c46fca
commit 6318be5aad
3 changed files with 36 additions and 19 deletions

View file

@ -1,4 +1,4 @@
(library
(name mte)
(wrapped false)
(libraries logs h2))
(libraries logs h2 lwt))

View file

@ -39,8 +39,8 @@ let request_handler request =
| [ "" ] ->
let content = home_page_text in
let headers = default_headers ~content `Text_plain in
{ status= `OK; headers; content }
Lwt.return { status= `OK; headers; content }
| _ ->
let content = "Not found." in
let headers = default_headers ~content `Text_plain in
{ status= `Not_found; headers; content }
Lwt.return { status= `Not_found; headers; content }