Preparing for this chapter
In this chapter, I continue to use the webapp
project from Chapter 7. No changes are required to prepare for this chapter. Open a command prompt, navigate to the webapp
folder, and run the command shown in Listing 8.1 to start the build tools.
Listing 8.1: Starting the build tools
npm start
Open a web browser, request http://localhost:5000
, enter a message into the text field, and click the Send Message button. The client-side JavaScript code will send the contents of the input
element to the backend server, which will pipe it back to the browser in the response, as shown in Figure 8.1.
Tip
You can download the example project for this chapter – and for all the other chapters in this book – from https://github.com/PacktPublishing/Mastering-Node.js-Web-Development. See Chapter 1 for how to get help if you have problems running the examples.
Figure 8.1: Running the example application