There are two ways of doing debugging; let's see both methods here.
If you just want to stay in your IDE, Visual Studio Code lets you directly start a debugging session. Just click on the code you want to run (a reminder: pick the code in the out/ directory, and don't forget to use npm run build) and pick Debug | Start Debugging in the menu. The window will look as follows:
Alternatively, if you'd rather keep using your favorite developer tools from Chrome, there's an alternative you can use. First, in Chrome, look for N.I.M., the Node.js V8 Inspector Manager, which can be found at https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj, and add it to your browser.
After doing that, open the N.I.M. console by going to about:inspect, and you'll get something like what's shown in the following screenshot:
All you have to do now is go to VSC, or a shell session, and run your code. Before doing this, add the --inspect option, as in node --inspect out/restful_server.js. You will receive the following output:
After that, a window will open, and you'll have full access to Chrome's debugger console, as shown in the following screenshot:
Finally, in any case, you are ready to start a serious debugging session; let's see what you can do.