hapi-shaper
v1.0.0
Published
A simple plugin to generate consistent json response using hapi.js
Downloads
1
Readme
About
This is a simple plugin to generate consistent json response using hapi.js.
Usage Example
const Hapi = require('@hapi/hapi')
const server = Hapi.server({
port: 3000
})
server.route({
method: 'GET',
path: '/test',
handler (request, h) {
return h.success(
{
what: 'ever'
},
201
)
}
})
;(async () => {
await server.register({
plugin: require('hapi-shaper')
})
await server.start()
console.log(`server running at ${server.info.uri}`)
})()