0.1.8 • Published 7 years ago

hapiman v0.1.8

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

hapiman

API documentation generator (like lout) + API explorer (like postman) for hapi and joi.

Description

hapiman is a documentation generator for hapi servers, providing a human-readable guide for every endpoint using the route configuration and Joi validations.

In addition this will provide an API explorer for developers to play with the API.

Usage

hapiman depends on vision and inert, make sure you register them with hapi.

var Hapi = require('hapi');
var server = new Hapi.Server();

server.connection({ port: 80 });

server.register([require('vision'), require('inert'), { register: require('hapiman') }], function(err) {
});

server.start(function () {
     console.log('Server running at:', server.info.uri);
});

Parameters

There is nothing to pass atm as this is not the final release. But the idea is you being able to customise the template and also add auth to this.

Ignoring a route in documentation

If you want a specific route not to appear in hapiman's documentation, you have to set hapiman settings for this specific route to false.

Here is an example snippet of a route configuration :

{
  method: 'GET',
  path: '/my/route',
  config: {
    ...,
    plugins: {
      hapiman: false
    }
  }
}
0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago