This “PricingDataAPI” based on NodeJS / Express. The service is be responsible for providing the access to a pricing API. With help of the API, 3rd-party applications can retrieve an actual pricing data in the JSON format
- mongodb
- redis
- yarn install
- yarn start
- point your Postman to http://localhost:3000
- GET /pricing[?coupon=couponName]
- mock mongo models (mockgoose?). I know that would not to be unit testing but.. this is a sandbox after all :)
- controller test fails when mongo is unreachable (see #1)
- move mongo query caching to the schema's post-hook (or to a mongoose plugin)
- ... freedom for a perfectionist
- npm run test - will invoke the tests and show the coverage