Getting Started with hapi.js

Build well-structured, testable applications and APIs using hapi.js
Preview in Mapt

Getting Started with hapi.js

John Brett

2 customer reviews
Build well-structured, testable applications and APIs using hapi.js
Mapt Subscription
FREE
$29.99/m after trial
eBook
$16.80
RRP $23.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$16.80
$29.99
$29.99 p/m after trial
RRP $23.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Getting Started with hapi.js Book Cover
Getting Started with hapi.js
$ 23.99
$ 16.80
Node.js 6.x Blueprints Book Cover
Node.js 6.x Blueprints
$ 39.99
$ 28.00
Buy 2 for $34.30
Save $29.68
Add to Cart

Book Details

ISBN 139781785888182
Paperback156 pages

Book Description

This book will introduce hapi.js and walk you through the creation of your first working application using the out-of-the-box features hapi.js provides. Packed with real-world problems and examples, this book introduces some of the basic concepts of hapi.js and Node.js and takes you through the typical journey you'll face when developing an application. Starting with easier concepts such as routing requests, building APIs serving JSON, using templates to build websites and applications, and connecting databases, we then move on to more complex problems such as authentication, model validation, caching, and techniques for structuring your codebase to scale gracefully. You will also develop skills to ensure your application's reliability through testing, code coverage, and logging.

By the end of this book, you'll be equipped with all the skills you need to build your first fully featured application. This book will be invaluable if you are investigating Node.js frameworks or planning on using hapi.js in your next project.

Table of Contents

Chapter 1: Introducing hapi.js
Node.js – a prerequisite to learning hapi.js
The hapi philosophy versus other frameworks
Creating our first hapi.js server
Summary
Chapter 2: Adding Functionality by Routing Requests
Server routing
hapi routing algorithm
hapi request life cycle
hapi request object
The reply interface
Serving static files with inert
Serving templates with vision
Summary
Chapter 3: Structuring Your Codebase with Plugins
Structuring applications
hapi plugins
Exposing and consuming plugins
The hapi plugin ecosystem
Composing applications from plugins
Summary
Chapter 4: Adding Tests and the Importance of 100% Code Coverage
Why is the importance of testing overlooked?
The benefits and importance of testing code
Introducing hapi's testing utilities
Testing hapi applications with lab
Summary
Chapter 5: Securing Applications with Authentication and Authorization
Authentication
Authorization
Summary
Chapter 6: The joi of Reusable Validation
An introduction to validation
Introduction to joi
Validating hapi routes with joi
Documentation generation
Summary
Chapter 7: Making Your Application Production Ready
Persisting data
Introducing caching
Introducing logging
Debugging applications
General production advice
Further learning
Summary

What You Will Learn

  • Increase your productivity by taking advantage of the out-of-the-box features hapi.js provides
  • Build secure API servers
  • Create websites and applications using your favorite templating language
  • Leverage hapi.js plugins to better structure your codebase
  • Simplify your security workflows with the built-in authentication and authorization functionality of hapi.js
  • Ensure application reliability with testing and code coverage
  • Reduce code complexity using reusable validation logic with joi
  • Gather insight into your application performance via logging
  • Start the journey to building robust production-ready applications

Authors

Table of Contents

Chapter 1: Introducing hapi.js
Node.js – a prerequisite to learning hapi.js
The hapi philosophy versus other frameworks
Creating our first hapi.js server
Summary
Chapter 2: Adding Functionality by Routing Requests
Server routing
hapi routing algorithm
hapi request life cycle
hapi request object
The reply interface
Serving static files with inert
Serving templates with vision
Summary
Chapter 3: Structuring Your Codebase with Plugins
Structuring applications
hapi plugins
Exposing and consuming plugins
The hapi plugin ecosystem
Composing applications from plugins
Summary
Chapter 4: Adding Tests and the Importance of 100% Code Coverage
Why is the importance of testing overlooked?
The benefits and importance of testing code
Introducing hapi's testing utilities
Testing hapi applications with lab
Summary
Chapter 5: Securing Applications with Authentication and Authorization
Authentication
Authorization
Summary
Chapter 6: The joi of Reusable Validation
An introduction to validation
Introduction to joi
Validating hapi routes with joi
Documentation generation
Summary
Chapter 7: Making Your Application Production Ready
Persisting data
Introducing caching
Introducing logging
Debugging applications
General production advice
Further learning
Summary

Book Details

ISBN 139781785888182
Paperback156 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Node.js 6.x Blueprints Book Cover
Node.js 6.x Blueprints
$ 39.99
$ 28.00
Mastering Docker - Second Edition Book Cover
Mastering Docker - Second Edition
$ 39.99
$ 28.00
Learning Vue.js 2 Book Cover
Learning Vue.js 2
$ 35.99
$ 25.20
RESTful Web API Design with Node.js - Second Edition Book Cover
RESTful Web API Design with Node.js - Second Edition
$ 23.99
$ 16.80
Docker Bootcamp Book Cover
Docker Bootcamp
$ 27.99
$ 19.60
Building Slack Bots Book Cover
Building Slack Bots
$ 31.99
$ 22.40