Preface

Node.js has become one of the most exciting development platforms in recent times. Combined with the largest package ecosystem in the world, npm, it has become a game changer in enabling higher developer productivity strides in improved application performance and a more enjoyable developer experience overall, which has lead to widespread industry adoption.

This book is focused on hapi.js, which is a rich Node.js framework for building applications and services with the goal of enriching the development experience further. It aims to increase your productivity by providing the tools you need when you want them and getting out of the away when you don't.

Developed by the talented team at Walmart Labs to handle the pressures of the Black Friday traffic, the busiest day of online retail on the calendar, it is proven at scale and has since seen wider adoption, participation, and collaboration from the wider community. Its growing adoption can be put down to how easy it is to use and get started with along with its proven stability.

The Node.js programming paradigm is quite different to other server-side technologies, and as such, it can be common for developers to get stuck on design and programming problems, such as dealing with the asynchronous nature of JavaScript and structuring an application as it grows. This is where hapi.js excels; it enables developers to focus on writing reusable business logic instead of losing time focusing on building application infrastructure without obscuring important implementation details.

While it was originally built as a framework focused toward the rapid development of RESTful APIs, thanks to its fantastic ecosystem, it has grown into a fully-fledged framework suited to building static file servers, websites, and web applications with excellent support for building real-time applications added more recently.

Due to the modular plugin approach it provides, it allows an easier collaboration between teams in larger enterprise environments as well as an easy point of integration for third-party libraries.

If you plan to use hapi.js in your next project, whether it be a side project, work project, or open source project, this book seeks to give you an excellent point at which to get started and solidify any knowledge you might have if you have used Node or hapi.js before.

What this book covers

Chapter 1, Introducing hapi.js, serves as an introduction to hapi.js and some prerequisite learning of Node.js. It explains what hapi.js is, who created it, why it needs to exist, and how to create a simple hapi.js server.

Chapter 2, Adding Functionality by Routing Requests, is the beginning of your journey of building applications with hapi.js. It will cover some basics, such as routing and building APIs, websites, and applications with hapi.js, and will also cover some differences in design compared to other Node.js-based frameworks.

Chapter 3, Structuring Your Codebase with Plugins, introduces the plugin API in hapi.js, which is one of its core features. It will walk you through how to simplify an application structure gracefully using plugins and also cover server orchestration using modules from the hapi.js ecosystem.

Chapter 4, Adding Tests and the Importance of 100% Code Coverage, explores the importance of adding tests to an application. It will introduce you to some of the testing tools available in the hapi.js ecosystem and also guide you toward getting 100% code coverage with your tests.

Chapter 5, Security Applications with Authentication and Authorization, takes a deep dive into how authentication works in hapi.js with practical examples of different authentication protocols, including social logins. It also demonstrates scopes and how to use them to add permission levels to your applications.

Chapter 6, The joi of Reusable Validation, deals with the topic of validation in applications using the joi validation library from the hapi.js ecosystem. It covers how to validate objects and route configurations and how to reuse this to generate documentation for applications.

Chapter 7, Making Your Application Production Ready, covers multiple topics to leave you ready to build your first application, such as integrating popular databases and adding caching and logging to applications to help scale an application as well as give it visibility when running in a production environment. It also covers a variety of other sources to continue learning more about hapi.js.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.110.155