This project contains the material created for Async Special - Hapi.js Workshop on 6th Dec 2014. The examples are still been updated, but should be of use to anyone learning about Hapi.
This is a example bookmark API built with hapi. I am still updating and adding to this example.
There are also the staged builds from the workshop:
- bookmarks-api (routes, static assets)
- bookmarks-api (templates, handlers, database)
- bookmarks-api (plug-ins, documentation)
There are 4 simple examples of the use of different authentication strategies.
During the workshop a number of people ask about patterns of database connection for hapi. So I have created two examples projects to show approaches. The shared-connection is my favoured approch, but maybe built using promises.
During the workshop I showed logging of requests information using uses the good and good-console plug-ins. I have created simple examples of how to add these plug-ins to your project.
I wrote a prerequisites document on the software need to run the code and some tools that would help you build and debug the projects. If you wish to run these examples please read this first.
I started writing some workshop notes, but did not finnsh them in time for the workshop. I have kept them in the project for reference. If your looking for good tutorials try (hapi site)[http://hapijs.com/tutorials], rather than these notes.
Expand on these subjects:
Share-code or singleton pattern in modulesMiddleware and hapiExport vs module.exports- The importants of HTTPS
- Deploying app
Build examples of:
Update to v0.8.x of hapiShare-code or singleton pattern in modulesShared schema's across application layersUsing server.ext events for middleware like functionally- Locking endpoints and routes to HTTPS or HTTP
- Update whole project with promises
If you find any issue please file here on github and I will try and fix them. If you are considering sending a pull request please add tests for the functionality you add or change.