Designed so that all network requests could be forwarded through Charles Proxy (or similar proxy service).
npm i network-request-proxy
At the very top of your entry file
require("network-request-proxy")("http://127.0.0.1:8888");
.......
Each of the following calls will be shown in Charles Proxy (or other proxy tool).
require("network-request-proxy")("http://127.0.0.1:8888");
const axios = require("axios"),
qs = require('qs');
axios.get("http://some/url/")
.then(res => console.log(res.data))
.catch(e => console.error(e));
axios.get("https://some/url/")
.then(res => console.log(res.data))
.catch(e => console.error(e));
axios.post("https://some/url", qs.stringify({ 'bar': 123 }))
.then(res => console.log(res.data))
.catch(e => console.error(e));
If you want to log the requests that get sent out as well as proxy them you can set the cli enviroment variable DEBUG=network-request-proxy
and this will log all requests that are sent.