Notoriously Psychedelic Modules

    express-able

    0.4.4 • Public • Published

    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.

    Keywords

    none

    Install

    npm i express-able

    DownloadsWeekly Downloads

    1

    Version

    0.4.4

    License

    MPL 2.0

    Last publish

    Collaborators

    • avatar