Right now we have hardcoded the object values, which usually never happens in a real-world application; let's get these values from an external API. For practicing purposes we have created an external API to get the data in JSON format.
If you visit http://restro.nalwaya.com/restaurants/search.json?city=Chicago or use the curl
command instead, it will return the restaurants we have seeded for Chicago in JSON format (note that this is fictitious data, you might not actually find them in Chicago city).
Let's run the following curl
command to get the data:
> curl "http://restro.nalwaya.com/restaurants/search.json?city=Chicago" [{ "name":"Polka Dots", "thumb_url_image":"http://restro.nalwaya.com/system/ restaurants/avatars/000/000/001/thumb/hotel.jpg?1352812187", "food_type":"Italian", "desc":"Best Italian food in city" }, { "name":"Striker", "thumb_url_image":"http://restro.nalwaya.com/system/ restaurants/avatars/000/000/002/thumb/ ...