In this tutorial we will create a simple REST API using the Node and Hapi framework. We will create a simple server with API which returns the books data and allow us to create, update and delete books. Getting started To follow this tutorial you should have the basic fundamentals of using command line. All
This tutorial is compatible with hapi v17. Node and Hapi should be installed for work with this tutorial. In Hapi we can use different template engines to achieve dynamic HTML with dynamic data. One of this engines – Handlebars. In this tutorial we will learn how to use handlebars with Hapi framework. Setup the server
This tutorial is compatible with Hapi v17.8.1 The Inert plugin provides a wide range of functionality to work with files in routes in Hapi. First of all you need to install the Inert module to your app using NPM or Yarn and register it before your server will start.You can install it in terminal using the next commands:
This tutorial is compatible with Hapi v17.8.1To create a simple redirect we can use the .redirect() method in the handler of route. This method takes a relative or an absolute URI used to redirect the client to the passed resource. It sets the 302 HTTP redirection: Also, the second way to set the 302 redirect: The