title: How can I get the HTML data from a post request on the server via express?
body: <p>HTML file</p>
  <pre><code> &lt;!DOCTYPE html&gt;
      &lt;html&gt;
          &lt;style&gt;
              textarea {
                  width: 500px;
                  height: 500px;
              }
          &lt;/style&gt;
          &lt;head&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;h1&gt;CSV Report Generator&lt;/h1&gt;
              &lt;form method='POST' action='/' id='submitCSV'&gt;
                  &lt;textarea name='csv' form='submitCSV'&gt;&lt;/textarea&gt;
                  &lt;br&gt;
                  &lt;input type='submit' value='Get CSV'&gt;
              &lt;/form&gt;
              &lt;br&gt;
              &lt;div&gt;
                  &lt;h3&gt;CSV Response&lt;/h3&gt;
              &lt;/div&gt;
          &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  <p>Relevant Server Side Code</p>
  <pre><code>app.post('/', (req, res) =&gt; {
      let csvReport = parseJSON(req.body.csv);
      // res.end('&lt;h1&gt;Hello World&lt;/h1&gt;');
      res.end(csvReport);
  /*
      templating &amp; html 
      file system - read file from client &amp; insert CSV into appropriate spot -&gt; send back to client
      readfile =&gt; 'string of all the html'
  */
  })
  </code></pre>
  <p>Basically, I'm sending in some JSON data through my form to the server via a post request. Once I have the JSON data, I'm basically parsing it into a different format and sending that back (code not shown since it's not relevant). What I'm trying to do is somehow read the HTML that the form is contained in so I can insert it into the HTML and send that whole HTML string back as the server response. It is dumb as there's many tools to use instead but I am doing it this way because I am required to do so. How can I read the contents of my html file from which the request came from?</p>