Demonstrate how to write clean express controllers using function currying and promises.
- Promises helps avoiding callback hell
- Currying helps code reuse
git clone https://gist.github.com/8472f35350a7031e2cb2.git express_curry_promise
cd express_curry_promise
npm install
node app.js
... in another shell
curl -v http://localhost:3000/flip/head
curl -v http://localhost:3000/flip/tail
curl -v http://localhost:3000/flip/head
curl -v http://localhost:3000/flip/tail