0

I am using NestJS to build a web app from which I call an external API to retrieve data. Now, I want to inspect all the requests that are sent from my app. For example, in a web browser, I can inspect all the requests I send to my server through the console.

Could you please advise on how I can achieve this? Whether it's in Node.js, NestJS, or by using some other software.

NOTE: I am using node-fetch to make network calls.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • Maybe I didn't understand the question because it seems really straight forward, for sure you have a function/method where you send the requests; you have everything you need there! dump it to a file, log it in console, write it to a db, etc. – Emad Mamaghani Jun 10 '23 at 10:18

3 Answers3

1
  1. If your service is deployed in any serverless platform for GCP cloud run, cloud functions, app engine then console logs will be streamed in log explorers.

  2. Other possible way is build your own log streaming service or create log dumps in a file using winston logger.

  3. There are few available tools in market for which if u pass your data in a required manner they can show the logs in table format in their dashboard. Easy to monitor and query with filters

Deepak
  • 11
  • 1
0

Outside of logging the node-fetch http calls, I don't believe there is a built-in tool for outgoing http requests.

-1

I found the solution, there is a tool (httptoolkit) that allows to inspect all the requests that are sent from anywhere (browser, container, terminal ...)

  • 1
    Please [avoid link only answers](http://meta.stackoverflow.com/tags/link-only-answers/info). Answers that are "barely more than a link to an external site” [may be deleted](http://stackoverflow.com/help/deleted-answers). – Quentin Jun 12 '23 at 13:49