title: Multiple Website Status Check with Node JS
body: <p>I want to run a node app that would check multiple websites and responds with the proper status code. I am using the 'request' module of Node itself. </p>
  
  <p>The code I have is:</p>
  
  <pre><code>const request = require('request')
  
  function getStatus() {
      request('https://www.google.com', function(error, response, body) {
  
          result = response.statusCode;
  
          if(!error &amp;&amp; response.statusCode == 200) {
              document.write("The Site Is Up");
              console.log(result);
          } else {
              console.log("The Site Is Down");
          }
      });
  }
  </code></pre>
  
  <p>This works fine for one website. But, I want to know how can I run the same function for multiple sites? For example, the url should be fed from an Array of urls.</p>
  
  <p>If I have an array of urls such as:</p>
  
  <pre><code>var urls = ["https://www.google.com", "https://www.yahoo.com"];
  </code></pre>
  
  <p>How can I feed these individual urls to the request function? and get results for each site?</p>