© Kanika Sud 2020
K. SudPractical hapihttps://doi.org/10.1007/978-1-4842-5805-7_5

5. Building on the Basics: Validation, Authentication, and Plugins

Kanika Sud1 
(1)
Kanika, Chandigarh, India
 

In the previous chapter, we were able to show you how to get your first tiny app up and running. Now, we’ll add the topping to the pizza. Before we dive into validating our requests, we organize them. After organizing our code, we validate our input using a library called Joi (pronounced joy), authenticate our routes, and build a minimal plugin to appreciate modularized code.

Note that we haven’t added exception handling to any of our code, and that’s intentional for now. We’ll fill that gap in the next chapters as it’s very easy to follow. As a standard, unhandled ...

Get Practical hapi: Build Your Own hapi Apps and Learn from Industry Case Studies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.