Skip to content
Wheater edited this page Sep 23, 2015 · 2 revisions

Hapi is a NodeJS middelware extension.

Links

Hapi: HapiJS.com Github: https://github.com/hapijs/hapi Github-wiki: https://github.com/hapijs/hapi/wiki

Current Usage

In the current iteration, Hapi is used for as a REST API middleware on the NodeJS instance. We are listening on port 8000 accepting rest API calls from the front-end (Ember).

Testing

Testing the server instance in Hapi accomplished via Lab and Code npm packages. Hapi has a server.inject API for simulating HTTP calls to the REST API. By mocking those calls, we test the results of the rest of the server response. Testing is done with a real instance of MongoDB for simplicity, as mocking the database brings many challenges of its own.

Authentication

Authentication in Hapi is described here: http://hapijs.com/tutorials/auth

Clone this wiki locally