koa-accepts
Simple middleware to change the format of your response based on the HTTP accept header, using q weights via the negotiator library.
Supported formats:
application/yaml
: YAMLapplication/x-msgpack
: MsgPackapplication/json
: JSON.stringify
If anything else it will fall back to doing what koa normally does (JSON).
Quickstart
app.useaccepts