hmm, it really seems like that - however I am not sure how can I avoid it except wrapping all the middleware by myself
I don’t think the ring-defaults itself is slow, it’s just a collection of things. Someone could bench the included mw separately and see if there are slow ones. I would guess it’s the static resource encoding inspector thingie that’s causing 98% of the computation. If so, you could take some parts of those for the api-routes and apply the site-stuff only for the static routes. Does that make sense?
and, when done, some “good practise” example setup would be great.
also, ring-defaults has some parameter-settings, which also are included in compojure-api defaults. Here are the chains: * https://github.com/metosin/compojure-api/blob/master/src/compojure/api/middleware.clj#L264-L290 * https://github.com/ring-clojure/ring-defaults/blob/master/src/ring/middleware/defaults.clj#L98-L117
I am trying to use compojure-api with spec tools but I get
Caused by: java.lang.NullPointerException, compiling:(ring/util/http_response.clj:1142:1)
...
Can't import ring.util.response/get-charset, try updating to Ring 1.6.0+
my project looks like that
[ring/ring-core "1.6.3"]
[metosin/compojure-api "2.0.0-alpha15"]
and lein deps :tree
only yields ring-core version 1.6.3
I can't figure out what's wrong 😭@jazzytomato do you use lein-ring
? It brings extra (potentially) old deps at runtime, overriding the project setup. Updating to latest should help.
I don't use lein-ring
I think lein clean fixed it...
sorry, I'm a newbie 😄
was about to suggest lein-clean :)
thanks 🙇