Socket
Book a DemoInstallSign in
Socket

hapi-able

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-able

hapi-able =========

latest
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

hapi-able

A hapi plugin to add Able A/B testing.

Example

var server = new hapi.Server()

server.register(
  {
    register: require('hapi-able'),
    options: {
      dir: './experiments',
      git: 'git://github.com/dannycoates/able-demo.git#master',
      addRoutes: true,
      watch: true
    }
  },
  function (err) {
    if (err) {
      console.error('plugin error', err)
      process.exit(8)
    }
  }
)

server.route(
  {
    path: '/foo',
    handler: function (request, reply) {
      reply(request.plugins.able.choose('bar'))
    }
  }
)

Registration Options

  • dir : optional directory where experiments are stored. Defaults to ./experiments in the current working directory.
  • git : optional a github url to watch for experiment changes.
  • addRoutes : optional adds routes for using Able from a client browser. Defaults to false.
  • watch : optional poll git for changes to experiments. Defaults to false.

FAQs

Package last updated on 12 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts