This is a Rest API based on Spring boot. This APi enables users to get product details [name and price] and to update the price with the product id.
Mongo DB Atlas is used to store # info and the product details are retrieved from external API - https://redsky.target.com
This application is deployed in Amazon EBS. Currently this is hosted manually as Jar but can be automated later.
If a product is in External API but no # info, it just displays the product name if a product has # info in mongo it displays both
curl -X GET
http://myretail-env.eba-6mmu6dpq.us-east-1.elasticbeanstalk.com/myretail/v1/products/13860431
-H 'cache-control: no-cache'
curl -X PUT
http://myretail-env.eba-6mmu6dpq.us-east-1.elasticbeanstalk.com/myretail/v1/products/13860431
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-d '{
"id": "13860431",
"price": "12.29",
"name": "The Hunters (DVD)",
"currency": "USD"
}'
-
Git clone the application git clone https://github.com/mmeenapriya/myretailapi.git
-
Run gradle task ./gradlew clean build
-
Access API using url http://localhost:8080/myretail/v1/products/{id}
example: http://localhost:8080/myretail/v1/products/13860432
NOTE: No authentication is added at this point
- docker pull mmeenapriya/myretailapi:1.0
- docker run -p 5000:5000 --rm mmeenapriya/myretailapi:1.0