Skip to content

Instantly share code, notes, and snippets.

@goodmike
Created October 25, 2010 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save goodmike/645939 to your computer and use it in GitHub Desktop.
Save goodmike/645939 to your computer and use it in GitHub Desktop.
Using wrappers to mix ring and aleph handlers in moustache routes
(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