integreat-hapi

0.1.1 • Public • Published

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.

Build Status Coverage Status Maintainability

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.

Readme

Keywords

none

Package Sidebar

Install

npm i integreat-hapi

Weekly Downloads

0

Version

0.1.1

License

ISC

Unpacked Size

8.78 kB

Total Files

8

Last publish

Collaborators

  • kjellmorten