Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ibdknox
Created October 2, 2011 19:53
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ibdknox/1257857 to your computer and use it in GitHub Desktop.
Save ibdknox/1257857 to your computer and use it in GitHub Desktop.
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