diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dune | 3 | ||||
-rw-r--r-- | bin/leda.ml | 12 |
2 files changed, 10 insertions, 5 deletions
@@ -1,4 +1,5 @@ (executable (public_name leda) (name leda) - (libraries base gemini)) + (libraries base gemini lwt lwt_ppx) + (preprocess (pps lwt_ppx))) diff --git a/bin/leda.ml b/bin/leda.ml index 40074ff..8b98762 100644 --- a/bin/leda.ml +++ b/bin/leda.ml @@ -5,7 +5,11 @@ let test_parse s = M.gemini_to_canon_str (M.str_to_gemini s) module T = Gemini.MimeType.MimeType module R = Gemini.Request.GeminiTransaction(T) -let main = - match R.request "gemini://gemini.circumlunar.space/\r\n" with - | Some (_, _, s) -> print_endline s - | _ -> print_endline "oops" +let () = + Lwt_main.run begin + let req = R.string_to_request "gemini://gemini.circumlunar.space/\r\n" in + let%lwt response = R.transaction req in + match response with + | Some (_, _, s) -> Lwt_io.printl s + | _ -> Lwt_io.printl "ooops" + end |