Setting up a web server that serves static files

In this book, we will use the excellent Node.js web framework Express and the serve-static package to kick off a web server in under 10 lines of code. I will not go into the details about Express, but we will see that it’s very easy and straightforward to use for our purpose.

So, let’s add both the packages to our application. To do so, we open the terminal in the root directory of the project and execute the following commands in the terminal: