Skip to content
davidjamesstone edited this page Sep 24, 2016 · 1 revision

Server

The hapi server is the central component and is responsible for handling the requests and responses.

The configuration is found in config/server.json. Click (here)[config.md] to read more about configuration.

Why hapi?

Use of open source software is great in many ways but it can leave you vulnerable and exposed.

Node.js prides itself on the wealth of plugins available in the NPM package manager. For lots of development having free reign to pick and choose these packages is fine. For enterprise level development though, a more stringent approach should be adopted.

Hapi.js is an opensource framework for building web applications and services. The reason it is the choice for many enterprises/corporations is that it and its ecosystem of plugins has very strict guidelines on quality and testing. The packages are quality, pre-vetted components which give us a huge step up in terms of the resilience of the software we deliver.

It also gives us consistency over the stack of software and services we build.

Learn hapi - a tutorial for hapi

  • hapi - The core framework docs
  • glue - Server composer for hapi.js
  • good - A logging plugin (Ops, server and request logs)
  • boom - HTTP-friendly error objects
  • joi - validator for JavaScript objects
  • lout - browsable documentation generator
  • vision - Templates rendering support|
  • inert - Static file and directory handlers
  • More - The plugins directory and on NPM