Created
October 2, 2011 19:53
-
-
Save ibdknox/1257857 to your computer and use it in GitHub Desktop.
aleph and noir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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