How would you apply middleware to the contexts in this case instead of up a level where you pass service-routes api to a middleware? Or would you break the contexts out of the api?
with compojure-api 2.* you can set :middleware
option to api
(besides context
or endpoint. Something like:
(def service-routes
(api
{:middleware [...]}
(context "/unsecured"
:middleware [...]
(GET "/ping []
:middleware [...]
(ok)))))
(defapi is deprecated in 2.*)Hmm... I am using 1.1.12. 2.* is not out of alpha yet. Do you recommend updating?
I wonder if context has :middleware [print-middleware-3 print-middleware-4] from this https://github.com/metosin/compojure-api/wiki/Middleware