lwt request_handler
This commit is contained in:
parent
bd44c46fca
commit
6318be5aad
3 changed files with 36 additions and 19 deletions
2
src/dune
2
src/dune
|
|
@ -1,4 +1,4 @@
|
|||
(library
|
||||
(name mte)
|
||||
(wrapped false)
|
||||
(libraries logs h2))
|
||||
(libraries logs h2 lwt))
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue