Creating the HTML and client-side JavaScript code
To define the HTML document that will be delivered to the browser, create the static
folder and add to it a file named index.html
with the content shown in Listing 9.10.
Listing 9.10: The contents of the index.html file in the static folder
<!DOCTYPE html>
<html>
<head>
<script src="/bundle.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<button id="btn" class="btn btn-primary m-2">Send Request</button>
<table class="table table-striped">
<tbody>
<tr><th>Status</th><td id="msg"></td></tr>
<tr><th>Response</th><td id="body"></td></tr>
</tbody>
</table>...