From aa1aa76bbf8ba705317d3c30bbc0354b2367091d Mon Sep 17 00:00:00 2001 From: gered Date: Wed, 5 Jan 2022 18:01:43 -0500 Subject: [PATCH] have the http-kit instance returned as an HttpServer instance this is more flexible, allowing a few http-kit functions to be called against it (including one to stop http-kit), versus the alternate return type which is just a simple function that can be called to stop http-kit this is ALSO what i thought i had done already, thus why the stop function found below in this very same defstate is written to call `http-kit/server-stop!` which won't actually work without setting legacy-return-value? to false. oopsie! :-) --- .../leiningen/new/simple_web_service/src/root_ns/core.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/leiningen/new/simple_web_service/src/root_ns/core.clj b/resources/leiningen/new/simple_web_service/src/root_ns/core.clj index a54a93e..92847a6 100644 --- a/resources/leiningen/new/simple_web_service/src/root_ns/core.clj +++ b/resources/leiningen/new/simple_web_service/src/root_ns/core.clj @@ -169,9 +169,10 @@ bind "0.0.0.0"}} (:http-server config) server (http-kit/run-server (wrap-base #'handler) - {:port port - :ip bind - :server-header nil})] + {:port port + :ip bind + :server-header nil + :legacy-return-value? false})] (log/info (format "Started HTTP server listening on %s:%d" bind port)) server) :stop