1 | # @gar/hapi-json-api
|
2 |
|
3 | hapi plugin for enabling/enforcing json-api
|
4 |
|
5 | ## installing
|
6 |
|
7 | ```shell
|
8 | npm install @gar/hapi-json-api
|
9 | ```
|
10 |
|
11 | ## use
|
12 |
|
13 | ```javascript
|
14 | //where server is a hapi server
|
15 |
|
16 | server.register({
|
17 | register: require('@gar/hapi-json-api')
|
18 | options: {}
|
19 | });
|
20 | ```
|
21 |
|
22 | ## options
|
23 |
|
24 | Pass an optional `meta` parameter to options to have that included in
|
25 | the `meta` response namespace for all replies from your server
|
26 |
|
27 | ## notes
|
28 |
|
29 | Assumes the objects coming back from your handlers return data in proper
|
30 | json-api format. No validation yet.
|
31 |
|
32 | Rewrites Boom errors to be spec compliant.
|
33 |
|
34 | Enforces Accept/Content-type rules defined in spec
|