title: In Node js, what happens if a new request arrives and event loop is already busy processing a request?
body: <p>I have this file named <code>index.js</code>:</p>
  
  <pre><code>const express = require('express')
  const app = express()
  const port = 3000
  
  app.get('/home', (req, res) =&gt; {
      res.send('Hello World!')
  })
  
  app.get('/route1', (req, res) =&gt; {
      var num = 0;
      for(var i=0; i&lt;1000000; i++) {
          num = num+1;
          console.log(num);
      }
      res.send('This is Route1 '+ num)
  })
  
  app.listen(port, () =&gt; console.log(`Example app listening on port ${port}!`))
  </code></pre>
  
  <p>I first call the endpoint <code>/route1</code> and then immediately the endpoint <code>/home</code>. The <code>/route1</code> has <code>for loop</code> and takes some time to finish and then <code>/home</code> runs and finishes. My question is while app was busy processing <code>/route1</code>, how was the request to <code>/home</code> handled, given node js is single threaded?</p>