This is an experiment in using JSON logic to segment data based on a static configuration JSON.
Install and start the server:
npm install
npm run build
npm start
curl --location 'http://localhost:3333/segment/Person/Color'
curl --location 'http://localhost:3333/segment/Person/Color' \
--header 'Content-Type: application/json' \
--data '{ "favouriteColor": "green" }'
Should return:
{
"name": "Likes Green",
"id": "person-color-green",
"rule": {
"==": [
{
"var": "favouriteColor"
},
"green"
]
}
}