Turn off the default logger and handy new functions

coast.theta version 1.4.0 was released!

A lot of bug fixing surrounding middleware in this release along with a few nice additions:

with-prefix

Now instead of prefix-routes you can use with-prefix to prefix your routes with a given url prefix like so:

(coast/with-prefix "/api"
  [:get "/" :api/status])

Turn off the logger

You can now turn off the logger and substitute with your own logging middleware when you call coast/app:

(coast/app {:routes routes :logger false})

content-type?

There is now a very useful content-type? fn available instead of having to get-in to request headers and compare with string/starts-with?:

(coast/content-type? {:headers {"content-type" "application/json"}} :json) ; => true

There were quite a few problems surrounding middleware and specifically api middleware which are now fixed 🎉. I don't want to blame ring-defaults it was probably my lack of understanding them that caused so much trouble. So now they don't exist anymore! Coast now essentially calls in every single ring middleware library on it's own and sets them up in a way so that they all work correctly depending on if you call coast/site, coast/api or just send coast a vector of routes.