HTTP API for A/B testing:
GET /api/experiments: returns the JSON with A/B experiments
GET /api/statistics: returns the JSON statistic for a simple table of experiments
Fields "value" and "key" obey the law of distribution according to the formula laid down in business logic
{"experiments":
[
{ "value":"#0000FF",
"key":"button_color"},
{ "value":"10",
"key":"price"}
]
}
The request header should look like:
"Device-Token: test_user1"
bundle install
rails db:migrate
rails s
curl -H "Device-Token: test_user1" http://localhost:3000/api/experiments
yarn serve
http://localhost:8080