Is a RESTful service that can retrieve product and price details by ID. And set prices for a product in a mongodb. The two endpoints are
The GET response is also the same JSON expected for PUT when updating price. See samplePriceData.json for more details.
- Fork and clone this repository.
- Set up a mongoDb using mongo atlas. Guide
- Create a local .env file and paste this information from your mongo account:
PORT=3000
REDSKY_URL=https://redsky.target.com/v3/pdp/tcin/{1}?excludes=taxonomy,price,promotion,bulk_ship,rating_and_review_reviews,rating_and_review_statistics,question_answer_statistics&key=candidate
TODO mongo
- Run the following commands with latest node/npm installed
npm install
npm run start
- Run npm run test
Before deploying address the following.
- Restrict access to price setting endpoint.
- Determine default prices, currently anything without a price has it set to 9.99.