Chapter 6: Building Apps and Services with the Hapi.js Framework
by Mark Brown
Hapi.js is described as “a rich framework for building applications and services”. Hapi’s smart defaults make it a breeze to create JSON APIs, and its modular design and plugin system allow you to easily extend or modify its behavior.
The recent release of version 17.0 has fully embraced async
and await
, so you’ll be writing code that appears synchronous but is non-blocking and avoids callback hell. Win-win.
The Project
In this article, we’ll be building the following API for a typical blog from scratch:
# RESTful actions for fetching, creating, updating and deleting articles GET /articles articles#index GET /articles/:id articles#show POST /articles articles#create ...
Get Node.js: Related Tools & Skills 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.