Though many of the concepts in this course are still relevant, overall this course does not reflect our current course standards.
Table of Contents
HapiJS
Course Introduction
Ryan Chenkie introduces the course on Hapi.js, a web application server framework for Node.js, and reviewing the course agenda that includes making an API.Hapi.js Introduction
Ryan reviews the history of Hapi.js and its features that includes: error objects, validation, sessions, CORS, and logging. Then reviews Hapi.js ecosystem.Challenge 1: Create a Simple App
In this challenge, students create a Hapi.js server with a single route that responses to a GET request.Challenge 1: Solution
Ryan walks through the solution to Challenge 1 and answers questions from students.
Routes and Route Handlers
Rest API Principles
After reviewing principles of Rest API, Ryan discusses configuring routes with Hapi.js.Challenge 2: Setting Up Routes
In this challenge, students create two routes: one route to get data and another route to get a single object from within that data.Challenge 2: Solution
Ryan walks through the solution to Challenge 1 and answers questions from students.
Routes Prerequisiites
Prerequisites
When building an API, there are common tasks that need to be handled before a route is sent to a client: pull data out of a database and save new information; call other APIs and services, and run resource intensive calculations or tasks. Ryan illustrates how HapiJS provides these services called route prerequisites.Challenge 3: Creating Route Prerequisites
In this challenge, students add data with an API using two route prerequisites to check if data already exists and then prepare the data to be added to a handler.Challenge 3: Solution
Ryan walks through the solution to Challenge 3.
Error Handling
Boom Library
Discussing the types of errors that an application needs to provide, Ryan shows how boom library can help by providing a set of utilities for returning HTTP errors.Challenge 4: Return Errors
In this challenge, students use Boom to return a message when an application finds a mistake.Challenge 4: Solution
Ryan walks through the solution to Challenge 4.
Validation
Joi Module
Validating data helps make applications stable and secure. Ryan demonstrates how the Joi module can verify data with HapiJS.Challenge 5: Validating Routes
In this challenge, students use Joi to add validation to routes.Challenge 5: Solution
Ryan walks through the solution to Challenge 5.
HapiJS Plugins
Plugin Ecosystem
Taking a look at the HapiJS developer ecosystem, Ryan reviews plugins that serve many needs for application development including authenticiation, localization, documentation, and templating.Challenge 6: Using Plugins
In this challenge, students install and test two HapiJS plugins.Challenge 6: Solution
Ryan walks through the solution to Challenge 6.