From d8a477b04577b0eea59a8da46388a4be434805a1 Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Thu, 11 May 2023 12:49:57 +0300 Subject: [PATCH] Fix Ctrl+C handling Dream.run's signal setup was interfering with the Luv engine's signal handling. This is a fairly unique situation for dream-serve. --- dream_serve.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dream_serve.ml b/dream_serve.ml index 4fbaf78..06ddab9 100644 --- a/dream_serve.ml +++ b/dream_serve.ml @@ -152,7 +152,11 @@ let index_html next_handler request = (* Run the web server. *) let () = - Dream.run ~port:!port + Dream.log "Running at http://localhost:%i" !port; + Dream.log "Type Ctrl+C to stop"; + + Lwt_main.run + @@ Dream.serve ~port:!port @@ Dream.logger @@ index_html @@ inject_script