Understanding the project
The example project will use the features and packages introduced in Part 1 of this book. The backend server will be written in TypeScript and the code files will be in the src/server
folder. The TypeScript compiler will write JavaScript files to the dist/server
folder, where they will be executed by the Node.js runtime, which will listen for HTTP requests on port 5000
, as shown in Figure 9.1.
Figure 9.1: The backend server
The client-side part of the application will be simpler than the backend and used only to send requests and process responses to demonstrate server-side features. The client-side code will be written in JavaScript and packaged into a bundle using webpack. The bundle will be served by the webpack development server, which will listen for HTTP requests on port 5100, as shown in Figure 9.2.
Figure 9.2: Adding the client-side part of the project
The browser will make requests to the backend server on port 5000. The...