Communicating with REST APIs
To test the connection between our microcontroller and our REST API, please follow these steps:
- Log in remotely to your Ubuntu server.
- Navigate to an empty folder.
Clone the GitHub repository for this book using the following CLI command:
git clone https://github.com/PacktPublishing/Arduino-Data-Communications.git
- Navigate into the API project folder for this chapter using the following CLI command:
cd Arduino-Data-Communications/chapter-6/MyAPI/
- Inspect the folder contents using the following command:
ls -l
You should have an output similar to the following.
Figure 6.1 – The folder contents
- Feel free to read through any of the files to get a sense of what is contained in them. The
package.json
file contains the list of modules that we need to install. Install the dependencies by running the following command:npm install
- Navigate to the
routes
folder using the following command:cd routes
...