The static method of express allows us to serve all the static files of our application, that is to say, all HTML, CSS, and JS files that will comprise the front end visuals on the browser. In our case:
Public is the name of the directory where we find those files, for example, in our execise:
We can see that public contains a CSS and a JS directory, as well as an index.html and the expressions.js file.
By placing the express.static() in app.use, we let our server know that we will be rendering that index.html file and implementing all those static CSS and JS files related to it.
That is the purpose of the