Open micha opened 10 years ago
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})))
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.