Reader small image

You're reading from  Arduino Data Communications

Product typeBook
Published inNov 2023
PublisherPackt
ISBN-139781837632619
Edition1st Edition
Right arrow
Author (1)
Robert Thas John
Robert Thas John
author image
Robert Thas John

Robert Thas John is a data engineer with a career that spans two decades. He manages a team of data engineers, analysts, and machine learning engineers – roles that he has held in the past. He leads a number of efforts aimed at increasing the adoption of machine learning on embedded devices through various programs from Google Developers and ARM Ltd, which licenses the chips found in Arduinos and other microcontrollers. He started his career as a software engineer with work that has spanned various industries. His first experience with embedded systems was in programming payment terminals.
Read more about Robert Thas John

Right arrow

Implementing a REST API using JavaScript

So far, we have learned about creating tables, as well as inserting, updating, and deleting data using a relational database and a terminal. However, we do not have access to this terminal from our microcontrollers. To communicate with our database server from the microcontrollers, we will introduce a middleware, called an API server. There are various types of APIs but we will utilize REST.

We will implement a REST API using a server-side version of JavaScript called Node.js. From the website, it is described as an asynchronous, event-driven JavaScript runtime that lets you run JavaScript code outside of a web browser. You can learn more about it at https://nodejs.org/en. Let’s begin by installing the Node.js CLI from the Ubuntu CLI.

Installing Node.js

Follow these steps to install Node.js on your instance of Ubuntu Server:

  1. Log into the remote server using the following shell command, making sure you replace the IP address...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Arduino Data Communications
Published in: Nov 2023Publisher: PacktISBN-13: 9781837632619

Author (1)

author image
Robert Thas John

Robert Thas John is a data engineer with a career that spans two decades. He manages a team of data engineers, analysts, and machine learning engineers – roles that he has held in the past. He leads a number of efforts aimed at increasing the adoption of machine learning on embedded devices through various programs from Google Developers and ARM Ltd, which licenses the chips found in Arduinos and other microcontrollers. He started his career as a software engineer with work that has spanned various industries. His first experience with embedded systems was in programming payment terminals.
Read more about Robert Thas John