title: Why can't we do multiple response.send in Express.js?
body: <p>3 years ago I could do multiple <code>res.send</code> in express.js.<br />
  even write a <code>setTimeout</code> to show up a live output.</p>
  <pre><code>response.send('&lt;script class=&quot;jsbin&quot; src=&quot;http://code.jquery.com/jquery-1.7.1.min.js&quot;&gt;&lt;/script&gt;');
  response.send('&lt;html&gt;&lt;body&gt;&lt;input id=&quot;text_box&quot; /&gt;&lt;button&gt;submit&lt;/button&gt;&lt;/body&gt;&lt;/html&gt;');
  var initJs = function() {
    $('.button').click(function() {
      $.post('/input', { input: $('#text_box').val() }, function() { alert('has send');});
    });
  }
  response.send('&lt;script&gt;' + initJs + '&lt;/script&gt;');
  </code></pre>
  <p>Now it will throw:</p>
  <pre><code>Error: Can't set headers after they are sent
  </code></pre>
  <p>I know nodejs and express have updated. Why can't do that now? Any other idea?</p>
  <hr />
  <p>Found the solution but <code>res.write</code> is not in api reference <a href="http://expressjs.com/4x/api.html" rel="nofollow noreferrer">http://expressjs.com/4x/api.html</a></p>