Skip to content

Instantly share code, notes, and snippets.

@rickmode
Created October 20, 2010 18:26
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 rickmode/636999 to your computer and use it in GitHub Desktop.
Save rickmode/636999 to your computer and use it in GitHub Desktop.
My busted use of wrap-flash
(ns one-up.core
(:use [ring.adapter.jetty :only (run-jetty)]
[ring.middleware.session :only (wrap-session)]
[ring.middleware.flash :only (wrap-flash)]
[ring.middleware.file :only (wrap-file)]
[ring.middleware.file-info :only (wrap-file-info)]
[ring.middleware.reload :only (wrap-reload)]
[ring.middleware.stacktrace :only (wrap-stacktrace)]
[one-up.view :only (main-routes)]
one-up.middleware))
(def production?
(= "production" (get (System/getenv) "APP_ENV")))
(def development?
(not production?))
(def app
(-> #'main-routes
(wrap-session)
(wrap-flash)
(wrap-file "public")
(wrap-file-info)
; (wrap-request-logging)
(wrap-if development? wrap-reload '[one-up.core one-up.data one-up.middleware one-up.view])
(wrap-bounce-favicon)
(wrap-exception-logging)
(wrap-if production? wrap-failsafe)
(wrap-if development? wrap-stacktrace)))
(defn boot []
(let [port (Integer/parseInt (get (System/getenv) "PORT" "8080"))]
(run-jetty #'app {:join? false :port port})))
@rickmode
Copy link
Author

Solution found: need to flip order of wrap-session and wrap-flash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment