Creating the list page
- Run your unsecured Spring Boot backend. The cars can be fetched by sending the
GETrequest to the
http://localhost:8080/api/carsURL, as shown in Chapter 4, Creating a RESTful Web Service with Spring Boot. Now, let’s inspect the JSON data from the response. The array of cars can be found in the
_embedded.carsnode of the JSON response data:
Figure 13.1: Fetching cars
- Open the
carfrontReact app with Visual Studio Code (the React app we created in the previous chapter).
- We are using React Query for networking, so we have to initialize the query provider first.
You learned the basics of React Query in Chapter 10, Consuming the REST API with React.
QueryClientProvider component is used to connect and provide
QueryClient to your application. Open your
App.tsx file and add the...