- Git clone this repo
cd
into the app directory where you extracted the reponpm install
to grab all dependenciesnpm start
to run the app- Visit
http://localhost:3000/
in your browser.
npm run build
- Upload the
build/
directory to a static webhost.
- There were no images or models linked from the JSON response. I had to find images off the internet to get this to work. A better API would have links to product images.
- There were no IDs in the JSON response, but the list of spaceships comes back in the same order every time. Because of that I used the spaceship item's position in the array/index as a pseudo-key. This means that the images I found etc. have to be specified in order that they appear in the JSON feed. A better API would have unique IDs somehow (either autoincrementing from the DB or some type of GUID/UUID).
- I cache the JSON response to keep from creating too many network requests on every page load. For frequently changing data this may not be a good strategy as content may expire.