npm.io
0.4.4 • Published 11 years ago

express-able

Licence
MPL 2.0
Version
0.4.4
Deps
2
Vulns
0
Weekly
0
Stars
1

express-able

Able A/B testing middleware for express

Example


var app = express()

app.use(
  require('express-able')({
    dir: './experiments',
    git: 'git://github.com/dannycoates/able-demo.git#master',
    addRoutes: true,
    watch: true
  })
)

app.get('/foo', function (req, res) {
  res.send(200, req.able.choose('bar'))
})

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.