diff --git a/dream.opam b/dream.opam index 04d137c9..738267b3 100644 --- a/dream.opam +++ b/dream.opam @@ -52,7 +52,7 @@ depends: [ "camlp-streams" "caqti" {>= "2.0.0"} "caqti-lwt" {>= "2.0.0"} - ("conf-libev" {os != "win32"} | "ocaml" {os = "win32"}) + # ("conf-libev" {os != "win32"} | "ocaml" {os = "win32"}) "cstruct" {>= "6.0.0"} "digestif" {>= "0.7"} # to_raw_string. "dream-httpaf" {>= "1.0.0~alpha3"} diff --git a/example/1-hello/Makefile b/example/1-hello/Makefile new file mode 100644 index 00000000..5784bc97 --- /dev/null +++ b/example/1-hello/Makefile @@ -0,0 +1,6 @@ +.PHONY : test +test : + killall hello.exe || true + dune exec -- ./hello.exe & + sleep 1; + bash -c "for (( i=0; i<2048; ++i )) ; do curl -s http://localhost:8080/ ; done" diff --git a/example/1-hello/hello.ml b/example/1-hello/hello.ml index 5411c9ee..7384eab2 100644 --- a/example/1-hello/hello.ml +++ b/example/1-hello/hello.ml @@ -1,3 +1,12 @@ let () = - Dream.run (fun _ -> - Dream.html "Good morning, world!") + Lwt_engine.set (new Lwt_engine.select); + + Dream.router + [ + Dream.get "/" (fun _ -> + Lwt.return + (Dream.response + ~headers:[ ("Content-Type", "text/plain") ] + "On macOS I leak.\n")); + ] + |> Dream.logger |> Dream.run ~port:8080