Bartender is a node.js express API service.
Use git clone and then node package manager to install the dependencies:
git clone https://github.com/bastianspirek/bartender.git
cd bartender && npm i
node index.js
Registered API endpoints are:
- POST
/order/:drink
where the body should containcustomerId
- GET
/history/
const axios = require('axios');
axios.post('http://localhost:3000/order/DRINK', {
customerId: 42281
}).then(res => {
console.log(res.data)
}).catch(error => {
console.log(error)
})
//Should log "Serving DRINK in 5000ms"
//Making two of these requests should result in a 429 response on the second one