Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
api-defaults will set content-types automatically which is incompatible with wrap-json-response #20
Oh, sorry. It's "incompatible". I already updated the title.
I will show some codes to reproduce the incompatible issue.
If I define
I can work around this simply by switching the order of the two middlewares, but demos I search from google always put
No, sorry. The diagram should look more like:
The middleware should wrap the handler, and there's only one adapter per connection to the client. In more complicated setups you can combine multiple handlers, e.g. Compojure works by combining "routes" (handlers that can return nil), and middleware can be applied to individual routes, as well as the top-level handler.
Oh, thanks. My understanding is almost the same as what your diagram express. And I do know handlers can be combined just like blueprints in Flask, which is a great feature for modularity.
The point I want to emphasize is