Skip to content

BigWednesdayIO/hapi-error-schemas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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])
      }
    }
  }
});

About

HTTP error responses for hapi apis

Resources

License

Stars

Watchers

Forks

Packages

No packages published