babashka/examples/httpkit_server.clj
2020-11-13 14:59:16 +01:00

15 lines
501 B
Clojure

(ns examples.httpkit-server
(:require [clojure.pprint :refer [pprint]]
[org.httpkit.server :as server]))
(defn handler [req]
(let [reply (str (slurp "examples/httpkit_server.clj")
"---\n\n"
(with-out-str (pprint (dissoc req
:headers
:async-channel))))]
{:body reply}))
(server/run-server handler {:port 8090})
@(promise) ;; wait until SIGINT