Open rhgksrua opened 8 years ago
Why not immediately call a real API, and stick with that one?
I though we were using our own product list before using any real api. Also, which real api are you talking about?
I agree on using static JSON files in the beginning to mock data, but building a working API to build our application against, that's one bridge too far (I think). We'll see what the others think.
I would also suggest we should mock data and test our application after that we can connect to an real API endpoint. For mocking test data we can use Faker module.
@vinaypuppal Thanks for your suggestion. I'll consider using Faker for other project but actually It looks that it doesn't provide any option to fake products.
@arreche Faker provides fake data in general form. You can use these from Faker module to generate fake product list depending what we need to show in UI
We should create a mock api endpoint to serve our products.
Then we can request to a URL (i.e
www.locahost.com/mockapi?search=laptop
) and return a JSON with only the products that we searched for.Features
/mockapi?search=laptop
.?search=userSearchTerm
).Our api doesn't have to have all the features that a real world api would have. But it should be able to do a simple search of our mock products.