Created
October 25, 2010 22:40
-
-
Save goodmike/645939 to your computer and use it in GitHub Desktop.
Using wrappers to mix ring and aleph handlers in moustache routes
This file contains 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
(ns dining-service | |
(:use aleph.core) | |
(:use aleph.http) | |
(:use net.cgrand.moustache) | |
) | |
(defn report-handler [response-channel request] | |
(enqueue response-channel | |
{:status 200 | |
:headers {"content-type" "text/plain"} | |
:body "This is where the report would be."})) | |
(declare my-app) | |
(def my-app (app | |
["hello"] {:get "Just Hello"} | |
["report"] {:get (inner-middleware-wrapper report-handler)})) | |
(defn boot [] | |
(start-http-server (outer-middleware-wrapper my-app) {:port 8080})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment