UNPKG

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