Week 5
http://hapijs.com
Last week we made a server and API using the in-built node modules. These modules provide us with objects such as response
, events such as 'data'
and methods such as server.listen()
which help us send, receive and use data sent through HTTP (the protocol for sharing data that the internet is built on). The focus this week will be a node framework called Hapi.
Hapi is an open-source framework that provides us with different objects and methods for abstacting HTTP (although of course much the same thing is happening under the bonnet!) and importantly gives us the ability to easily build in other capabilities. This is done through the use of plugins, node modules that we require directly into the instance of the server we create.
We will be covering the following Hapi plugins:
- Static file and directory handling with inert
- Authentication and session management with hapi-auth-cookie
- User input validation with joi
- Views and template rendering with vision and handlebars