Introduction to Node Servers with Hapi.js

27 minutes

hapi is a battle-tested, full-featured, framework for building web applications and services with Node.js. With integrated support for essentials like authentication, caching and validation, and a powerful plugin system, hapi is ideal for projects and teams of any size.

This course will introduce hapi, some of it’s plugins, and guide you through many of hapi’s core features.

pro-course-rss-logo

PRO RSS Feed

hapi.js - Up and running

hapi.js - Logging with good and good-console

P

hapi.js - Route parameters

P

hapi.js - Replying to Requests

P

hapi.js - Using the response object

P

hapi.js - Serving static files

P

hapi.js - View engines

P

hapi.js - POST and PUT request payloads

P

hapi.js - Extending the request with lifecycle events

P

hapi.js - Friendly error pages with extension events

P

hapi.js - Request Validation with Joi

P

hapi.js - Managing State with Cookies

P
node tutorial about hapi.js - Up and running

hapi.js - Up and running

1:40 node

hapi is a rock solid server framework for Node.js. Its focus on modularity and configuration-over-convention makes it the perfect match for any size development team. This video will introduce you to hapi by showing you the bare minimum needed to run a hapi server.

node tutorial about hapi.js - Logging with good and good-console

hapi.js - Logging with good and good-console

2:45 node PRO

hapi doesn't ship with logging support baked in. Luckily, hapi's rich plugin ecosystem includes everything needed to configure logging for your application. This video will introduce good, a process monitor for hapi, and good-console, a reporter for good that outputs to standard out.

node tutorial about hapi.js - Route parameters

hapi.js - Route parameters

3:24 node PRO

Routing is a fundamental aspect of any framework. In this lesson, you'll learn how to use path parameters in hapi's router. We'll also touch on how the router uses specificity to order routes internally.

node tutorial about hapi.js - Replying to Requests

hapi.js - Replying to Requests

1:52 node PRO

hapi's reply interface is one of it's most powerful features. It's smart enough to detect and serialize objects, buffers, promises and even streams. This video will demonstrate first hand how to use the reply method to send your data to the client, no matter the format.

node tutorial about hapi.js - Using the response object

hapi.js - Using the response object

1:45 node PRO

Think of hapi's reply() function as "what you want to say" and the response object as "how you want to say it". While reply controls the payload sent to the client, the response object will allow you to control how the client interprets the payload by manipulating status code, content type, state and more.

node tutorial about hapi.js - Serving static files

hapi.js - Serving static files

1:38 node PRO

hapi does not support serving static files out of the box. Instead it relies on a module called Inert. This lesson will cover serving static files using Inert's custom handlers.

node tutorial about hapi.js - View engines

hapi.js - View engines

2:00 node PRO

View engines, or template engines, allow you to maintain a clean separation between your presentation layer and the rest of your application. This video will demonstrate how to use the vision plugin with hapi to enable template support.

node tutorial about hapi.js - POST and PUT request payloads

hapi.js - POST and PUT request payloads

2:06 node PRO

hapi makes handling POST and PUT payloads easy by buffering and parsing them automatically without requiring additional modules or middleware. This video will demonstrate how to handle JSON and form based request payloads via hapi's route configuration.

node tutorial about hapi.js - Extending the request with lifecycle events

hapi.js - Extending the request with lifecycle events

1:54 node PRO

Instead of using middlware, hapi provides a number of points during the lifecycle of a request that you can hook-in to provide additional functionality, called "extension events". This lesson will give you an introduction to using extension events, and show how they can be used to manipulate the request or response in-flight.

node tutorial about hapi.js - Friendly error pages with extension events

hapi.js - Friendly error pages with extension events

2:00 node PRO

hapi automatically responds with JSON for any error passed to a route's reply() method. But what if your application needs errors rendered in HTML? This lesson shows how to implement friendly HTML error messages using hapi extension events.

node tutorial about hapi.js - Request Validation with Joi

hapi.js - Request Validation with Joi

3:15 node PRO

hapi supports request validation out of the box using the joi module. Request path parameters, payloads, and querystring parameters can be validated with joi's simple, yet powerful, notation. This lesson covers the basics of validating requests using joi.

node tutorial about hapi.js - Managing State with Cookies

hapi.js - Managing State with Cookies

3:05 node PRO

hapi has built-in support for parsing cookies from a request headers, and writing cookies to a response, making state management easy and straight-forward. It even has built in support for cookie encryption and auto detects when a cookie contains JSON, parsing or stringifying automatically.

Presented by:

Mike Frey

Mike Frey is a software developer living in Minneapolis, where he is the organizer for the local Node.js user group, NodeMN. He is most passionate about learning, teaching and mentoring others in the world of programming.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?