title: Making a API request from inside of a Nodejs application
body: <p>I'm trying to make a request to an external API so that I can use the response data in the response of my own API, but I can't seem to get the response data on it`s own so that I can use it in my own API, how would I use module.exports to return the response data from the file where I'm making the external API request ?</p>
  <pre><code>var axios = require(&quot;axios&quot;);
  
  var config = {
    method: &quot;get&quot;,
    url: &quot;https://some-api&quot;,
    headers: {},
  };
  
  axios(config)
    .then(function (response) {
       //how can I export response.data from the file
      console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
      console.log(error);
    });
  
  console.log(response);
  </code></pre>