0.1.1 • Published 5 years ago
integreat-hapi v0.1.1
Integreat routes wrapper for Hapi
Wrappes general route objects from one of the Integreat api packages, and maps routes, request objects, and response objects between Hapi and Integreat formats.
Getting started
Prerequisits
Node v8.6.
Installing
npm install integreat-hapi
Example of use with integreat-api-json
:
const hapi = require('hapi')
const integreat = require('integreat')
const jsonapi = require('integreat-api-json')
const greatHapi = require('integreat-hapi')
const great = integreat(...)
const routes = greatHapi(jsonapi(great))
const server = new Hapi.Server()
// ... whatever Hapi setup you need
server.route(routes)
server.start()
Note that this package will not alter content-type and will return Boom on errors. To be JSON-API compliant, use the hapi-json-api package.
Running the tests
The tests can be run with npm test
.