@boundstate/hapi-api-docs

Responsive Swagger docs for Hapi

Usage no npm install needed!

<script type="module">
  import boundstateHapiApiDocs from 'https://cdn.skypack.dev/@boundstate/hapi-api-docs';
</script>

README

hapi-api-docs

Resonsive Swagger documentation for Hapi.

Built using hapi-swagger and jensoleg/swagger-ui.

Usage

npm install @boundstate/hapi-api-docs
import * as Hapi from 'hapi';
import {hapiApiDocs} from '@boundstate/hapi-api-docs';

const server = new Hapi.Server();

server.register({
  register: hapiApiDocs,
  options: {
    basePath: '/',
    pkg: require('../package.json'),
    schemes: ['http'],
  },
}).then((err) => {

});

Tag the routes you wish to document with api.

Access the documentation at /documentation/.