Learn how to get and download the relevant API.
- [Instructor] I have some great news. Because there are multiple people taking this course, I want you to have your very own local instance of the API to avoid any collisions. In this chapter, I'll walk you through the steps to set this up. The first thing we want to do is configure the local hosts. So let's download and install MAMP, which will allow you to use your computer as the hosting server for your copy of the API. We can download MAMP from MAMP.info. Click the Free Download button, and choose the one for your operating system. After it's downloaded, double-click the installation file and follow the prompts to complete the installation. Now open the MAMP application and click the Start button. Once the server's started, click the Web Start button, which will open your browser and load the Start page. Now we want to create a database to hold our API data. So scroll down until you see the MySQL section. Click it, and then click the phpMyAdmin link. Now we want to create a database to hold our API data. In here, click New, and then enter the database name as API Testing DB, then click Create. Awesome, we have our new database, and now we can import the API data. But first, be sure to download the API Testing.zip file from the exercise files on LinkedIn and unzip that file on your computer. Now back to our database. Click the Import tab, then click the Choose File button. Then select the API Testing DB SQL file from the directory that we just unzipped and click Open. And then finally, click the Go button. Notice, now we have two tables, Products and Categories. Okay, we're almost done. The final step is to move that directory that we unzipped to the local server. So copy this API Testing folder. And we're going to paste it into the local host folder. To find out where your local host folder is, go back to the MAMP tab in your browser and remove everything after the port number and hit Enter. Now look for the document root. This location is where you should paste your API testing folder. After pasting the API testing folder into the local host folder, let's make sure that the API loads because this is a testing course, after all. We can do so by opening a new tab in our browser and pasting in this URL. So it's local host: your port number. In my case, it's 8888/API_testing/product/read.php. And we see that we successfully get a JSON response. Yay, we're all set up and ready to rock and roll. Thanks for hanging in there.