Chapter 8. Interacting with a Server
Now that Code Café has a polished, responsive UI, you are ready to add functionality. The site should not just be an online menu with a static collection of items. Instead, it should be the front end for data on a server. By the end of this chapter, Code Café will fetch the items from an API, making it easier to remove out-of-stock items and update prices.
To make this happen, you will first set up a back-end server and then make a network request to load the items from the server.
Setting Up the Server
Your downloaded resources file includes a server for Code Café called code-cafe-backend
.
Open a new terminal window or tab and navigate to the code-cafe-backend
directory:
Get React Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.