Skip to content

Instantly share code, notes, and snippets.

@pandeiro
Forked from ibdknox/alephNoir.clj
Created January 3, 2012 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandeiro/1557133 to your computer and use it in GitHub Desktop.
Save pandeiro/1557133 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