How to reply JSON and JSONP in Hapi

This tutorial is compatible with hapi v17. Node and Hapi should be installed for work with this tutorial. Using JSON We can always manually set headers and convert our object to JSON using JSON.stringify, but Hapi provides a method which is used to simplify this routine. In Hapi v16 we used the .reply  method in the

Getting Started With Swagger and Hapi

If you want to create a documentation for API in your Hapi project, you can use the Swagger. Swagger is open-source tool to create documentation for REST API services. I already told how to create a simple REST API with Hapi, so we will continue with an existing code. Adding Swagger to Hapi project The

Using Handlebars with Hapi

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

How to send files using Hapi

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: