Preparing for this chapter
To create the project for this chapter, open a new command prompt, navigate to a convenient location, and create a folder named webapp
. Run the command shown in Listing 4.1 in the webapp
folder to create the package.json
file.
Listing 4.1: Initializing the project
npm init -y
Run the commands shown in Listing 4.2 in the webapp
folder to install the packages that will be used to compile TypeScript files and monitor files for changes.
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 4.2: Installing tool packages
npm install --save-dev typescript@5.2.2
npm install --save-dev tsc-watch@6.0.4
Run the commands shown in Listing 4.3 in the webapp
folder to add the packages that will configure...