Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 416 Bytes

README.md

File metadata and controls

13 lines (10 loc) · 416 Bytes

ab-tests

A/B testing middleware for express.js using cookies with a round-robin distribution.

You will need the cookie-parser set to make it work.

Usage:

app.use(cookieParser());

const test = setABCookies("test");
app.get("/", test(), (req, res) => res.send("Hello variant 1!"));
app.get("/", test(), (req, res) => res.send("Hello variant 2!"));