Reader small image

You're reading from  Practical Python Programming for IoT

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838982461
Edition1st Edition
Languages
Right arrow

Adding a RESTful API client web page

The web page we are about to discuss is the one you interacted with previously to change the brightness of your LED when you visited http://localhost:5000 in your web browser. A screenshot of the web page is shown in Figure 3.1.

As we proceed through this section, we will be learning how to build this basic web page using HTML and JavaScript. We will discover how to make the HTML range component interact with the Flask-RESTful API server that we created in the previous section, so that when we change the range control (that is, slide the slider), our LED's brightness also changes.

You will find the page's code in the chapter03/templates/index_api_client.html filePlease review this file before proceeding to get an overall idea about what it contains.

The templates folder is a special Flask folder where template files are kept. An HTML page is considered a template in the Flask ecosystem. You will also find a...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Python Programming for IoT
Published in: Nov 2020Publisher: PacktISBN-13: 9781838982461