How to debug your Node.js app with Fiddler

Today I was asked to add the User-Agent header to yo Team so we can track its usage in Team Services. Like a good TDD developer I added the tests then wrote the code.  Once I had all my unit tests passing I wanted to use Fiddler to verify my headers were being sent correctly.  However, when I fired up Fiddler and ran yo team I did not see any traffic in Fiddler.

After doing some research I found a very simple solution. Luckily I am using request to make all my REST API calls and it supports proxies via environment variables. All I had to do was set the following environment variables and rerun yo team:

https_proxy=http://127.0.0.1:8888 
http_proxy=http://127.0.0.1:8888
NODE_TLS_REJECT_UNAUTHORIZED=0

SNAGHTML335befa4

Comments (1) -

Add comment

Loading