Preparing for this chapter
This chapter uses the part2app
project from Chapter 11. To prepare for this chapter, Listing 12.1 removes the client-side validation code, which won’t be used in this chapter.
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.
Listing 12.1: The contents of the client.js file in the src/client folder
document.addEventListener('DOMContentLoaded', () => {
// do nothing
});
Listing 12.2 updates the routing configuration for the example application.
Listing 12.2: The contents of the server.ts file in the src/server folder
import { createServer } from "http";
import express, {Express } from "express";
import httpProxy from "http-proxy";
import helmet...