Skip to content

Instantly share code, notes, and snippets.

@na-ka-na
Created September 7, 2010 11:52
Show Gist options
  • Save na-ka-na/568213 to your computer and use it in GitHub Desktop.
Save na-ka-na/568213 to your computer and use it in GitHub Desktop.
(defn with-login-check
[handler]
(fn [request]
(if (logged-in? request)
(handler request)
{:status 403
:headers {"Content-Type" "text/xml"}
:body "<forbidden/>"})))
(defn create-routes []
(->
(routes
(create-routes-1)
(->
(routes
(create-routes-2)))
(->
(routes
(create-routes-3))
(with-login-check))
(create-file-route)
(create-default-resource-not-found-route))
(with-session :memory)
(with-rest-header-to-method)
(with-cache-control {:no-cache true :must-revalidate true})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment