Liking cljdoc? Tell your friends :D

ephemeral-server

One-function library that helps to open ephemeral servers.

cljdoc badge GitHub license GitHub issues

In your project, require:

(require '[piotr-yuxuan.ephemeral-server :as ephemeral-server])

You now may open an ephemeral server that will live a short but beautiful life ✨.

(let [port (atom nil]
  (with-open [_ (ephemeral-server/open port ["/ping" {:get (constantly {:body "expected"})}])]
    ;; Now @port is set to its actual value.
    (->> (http/get (format "http://localhost:%s/ping" @port))
         deref
         :body
         slurp)))

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close