/myRetail

Primary LanguageJavaScript

myRetail Application

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.

Local Setup

  1. Fork and clone this repository.
  2. Set up a mongoDb using mongo atlas. Guide
  3. 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
  1. Run the following commands with latest node/npm installed
npm install 
npm run start
  1. Run npm run test

Considerations

Before deploying address the following.

  1. Restrict access to price setting endpoint.
  2. Determine default prices, currently anything without a price has it set to 9.99.