Skip to content

Commit

Permalink
Merge a1283bb into f802dda
Browse files Browse the repository at this point in the history
  • Loading branch information
cemremengu committed Nov 18, 2018
2 parents f802dda + a1283bb commit 818e074
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Coverage Status](https://coveralls.io/repos/github/fastify/fastify-accepts-serializer/badge.svg?branch=master)](https://coveralls.io/github/fastify/fastify-accepts-serializer?branch=master)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Serializer according to the `Accept` header
Serializer according to the `Accept` header. Supports Fastify versions < 2.0.0.

## Install
```sh
Expand Down Expand Up @@ -61,3 +61,4 @@ For each route, it's defined a SerilizerManager that has a merge of per-route an
The mime type `application/json` is always handled by `fastify` if no serializer is register for that mime type.

If no `default` key is specified in configuration, all requests with unknown `Accept` header will be replied with an 406 response (a boom error is used)

5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ function acceptsSerializerPlugin (fastify, options, next) {
})
}

module.exports = fp(acceptsSerializerPlugin)
module.exports = fp(acceptsSerializerPlugin, {
fastify: '<2.0.0',
name: 'fastify-accepts-serializer'
})

0 comments on commit 818e074

Please sign in to comment.