hapi-hobknob-client

A Hobknob client plugin for Hapi

Usage no npm install needed!

<script type="module">
  import hapiHobknobClient from 'https://cdn.skypack.dev/hapi-hobknob-client';
</script>

README

hapi-hobknob-client

Hapi plugin for returning an initialised hobknob client.

Build Status Dependency Status devDependency Status npm version

Usage

$ npm i hapi-hobknob-client --save
var server = new (require('hapi').Server)();
server.connection({ port: 3000 });

server.register([
    {
        register: require('hapi-hobknob-client'),
        options = {
          applicationName: 'the-name-of-your-app-in-hobknob',
          Hobknob : {
            etcdPort: 4001,
            cacheIntervalMs: 30000,
            etcdHost: 'your-etcd-host-here'
          }
        }
    }
], function (err) {
    if (err) {
        console.error('Failed to load plugin:', err);
    }

    server.start();
});

//server can be found on the request object if you don't have server in the current function
const testToggleEnabled = server.plugins['hapi-hobknob-client'].getOrDefault('testToggle', true);

Configuration

All config values are unchanged as per hobknob client.

Release History

v2.0.0 - Richard Wright 04-01-2017