Create a gist now

Instantly share code, notes, and snippets.

aleph and noir
(require '[noir.server :as server])
(use 'noir.core 'aleph.http 'lamina.core)
(defn async-response [response-channel request]
(enqueue response-channel
{:status 200
:headers {"content-type" "text/plain"}
:body "async response"}))
(defpage "/" [] "hey from Noir!")
(custom-handler "/async" [] (wrap-aleph-handler async-response))
(def handler (server/gen-handler))
(start-http-server (wrap-ring-handler handler) {:port 8083})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment