Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ring handler into middleware #3

Open
micha opened this issue Mar 18, 2014 · 1 comment
Open

Refactor ring handler into middleware #3

micha opened this issue Mar 18, 2014 · 1 comment

Comments

@micha
Copy link
Contributor

micha commented Mar 18, 2014

Castra shouldn't return 404s. Instead it should pass through to the next handler. This would make it possible to chain multiple castra middleware, for example.

@micrub
Copy link

micrub commented Oct 5, 2014

I have a question about chaining middleware in current castra state:

Is it possible to mix castra handler with compojure routes ?

(def server (atom nil))

(defn func1 []
    (do
      {:status 200
       :headers {"Content-Type" "text/json"}
       :body {:response {}})))

(defroutes handler
  (POST "/action" {params :params}
       (func1))

(defn app [port public-path]
  (->
    (handler)
    (castra 'example.api)
    (wrap-session {:store (cookie-store {:key "a 16-byte secret"})})
    (wrap-file public-path)
    (wrap-file-info)
    (wrap-multipart-params)
    (run-jetty {:join? false :port port})))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants