Hapi Hapi
A collection of helpers for setting up a Hapi server.
Usage
Controllers
Require a directory tree of controllers/routes:
HapiHapi = ; // assuming a server has been created HapiHapicontrollersserver __dirname + '/controllers';
Assets
Create a route for serving static assets:
HapiHapi = ; // assuming a server has been created HapiHapi;
You can also pass an array as the fourth argument to set up special files (eg. robots.txt, favicon.ico) that need to be served from the root path:
HapiHapi;
Views
Set up view handling (with Handlebars):
HapiHapi = ; // assuming a server has been created HapiHapi;
Within the views
directory you need to include a layouts
and partials
folder. Inside
layouts
you need to include a default.html
layout (or specify your own when rendering
views).
The third argument is a context
to pass into the Handlebars views.