hapi-error-schemas
v1.0.0
Published
Exposes error response schemas for hapi api server
Downloads
1
Readme
hapi-error-schemas
Currently supports the following http error statuses:
- 400
- 401
- 403
- 404
- 500
Usage
Install
npm install --save hapi-error-schemas
Use default statuses
const server = new hapi.Server({
connections: {
routes: {
response: {
status: require('hapi-error-schemas').statuses()
}
}
}
});
Override statuses
const server = new hapi.Server({
connections: {
routes: {
response: {
status: require('hapi-error-schemas').statuses([400, 404, 500])
}
}
}
});