Skip to content

Commit

Permalink
Fix Ctrl+C handling
Browse files Browse the repository at this point in the history
Dream.run's signal setup was interfering with the Luv engine's signal
handling. This is a fairly unique situation for dream-serve.
  • Loading branch information
aantron committed May 11, 2023
1 parent e13c6ec commit d8a477b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dream_serve.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8a477b

Please sign in to comment.