title: res.end() not closing the script execution in NodeJS
body: <p>return res.end() not closing script execution.
  Initially it renders the form and when i submit it executes the code block below closing brace of if statement.
  I think execution should have ended on the line return res.end().</p>
  <pre><code>const http = require(&quot;http&quot;);
  
  const server = http.createServer((req, res) =&gt; {
    const url = req.url;
    if (url === &quot;/&quot;) {
      res.write(&quot;&lt;html&gt;&quot;);
      res.write(&quot;&lt;head&gt;&lt;title&gt;FORM&lt;/title&gt;&lt;/head&gt;&quot;);
      res.write(
        &quot;&lt;body&gt;&lt;form action='/message' method='POST'&gt;&lt;input type='text' name='message' /&gt;&lt;button&gt;Send&lt;/button&gt;&lt;/from&gt;&lt;/body&gt;&quot;
      );
      res.write(&quot;&lt;/html&gt;&quot;);
      return res.end();
    }
    res.setHeader(&quot;Content-Type&quot;, &quot;text/html&quot;);
    res.write(&quot;&lt;html&gt;&quot;);
    res.write(&quot;&lt;head&gt;&lt;title&gt;APP&lt;/title&gt;&lt;/head&gt;&quot;);
    res.write(&quot;&lt;body&gt;&lt;h1&gt;Demo APP&lt;/h1&gt;&lt;/body&gt;&quot;);
    res.write(&quot;&lt;/html&gt;&quot;);
  });
  
  server.listen(4000);
  </code></pre>