learn hapi — Advanced API Validation With Custom Errors

Validating incoming user data is an important piece of your API. Make sure you heavily rely on hapi’s built-in validation features. The hapi core framework works great with the help of a schema validation library, called Joi. Never ever trust input data!

On your end, provide helpful error messages for faulty validations. Let developers find their problems with your API by pointing them directly to the issue and a helpful resource to find more details, like the API documentation.

That’s what you’ll add to your API in this tutorial: create a custom error that contains a link to the API documentation and also serve your own error message!

hapi Series Overview


Continue reading

University Enrollment Required

Future Students benefit from value packed videos and tutorials.

Enroll to receive exclusive content or sign in if you’re already a Future Student.

Enroll me for $15/mo

Explore the Library

Find interesting tutorials and solutions for your problems.