Code for Kata 5 is available in the app5 folder.
Up to now all data work has used the data.js
file to focus on frontend work.
We are now moving the data to a backend server ins aspnet core.
The idea here is to learn how a web app can interact with a backend server through REST API calls.
You will need 2 terminals
- Web API server
- go to
./app5
- run
dotnet restore
- run
dotnet build
- run
dotnet run
This should build the web api server and serve it at http:\\localhost:5000
- Web app
- go to ./app5/app/
- follow the instructions in the
README
.
You are given a server that exposes the following REST endpoints.
Write the JavaScript/React code to:
- List all products in home page when the app is loaded.
- you can use technologies like jQuery.ajax or fetch
- to add a package do yarn add
- Navigate to each product page
- Have hard links on products names
- Request product details when someone selected a products.
- Changes to the data should persist through sessions:
- Be able to remove a product
- Be able to add a product
- If you refresh the browser product changes should persist (this was not the case before)