-
Create a RESTful API that generates 20 different products.
-
It should resemble the following API: https://webacademy.se/fakestore/
Product example
{
"id": 1,
"title": "Fjällraven Backpack",
"description": "Your perfect pack for everyday use and walks in the forest."
"image": "https://picsum.photos/500?random=1",
"price": 109.95,
"category": "men clothing"
}
note the /v2 path. Part 1 and 2 need to be seperate for this assignment
-
The user should be able to get X amount of random items... https://webacademy.se/fakestore/v2/?show=5
-
and also search for specific categories. https://webacademy.se/fakestore/v2/?category=jewelery
-
Implement security optimizations. https://webacademy.se/fakestore/v2/?category=foo&show=100
Demo
[
{
"Category": "Category not found"
},
{
"Show": "Show must be between 1 and 20"
}
]
- Publish your API on Heroku.
NOTE: Using JSON_PRETTY_PRINT for demonstration purposes.
- All items '/v2' can do the same w/o queries
Security optimizations: