title: Take HTML form and pass values to variables in node.js function
body: <p>Problem Statement: I have a simple HTML form that asks for three numbers from the user. When they hit submit, I would the form to be passed to a node.js file and assign each value to a variable.</p>
  
  <p>Below is my HTML file:</p>
  
  <pre><code>&lt;body&gt;
  &lt;form action="/" method="post"&gt;
  &lt;fieldset&gt;
  First number: &lt;input type="number" name="param1"&gt;&lt;br&gt;
  Second number: &lt;input type="number" name="param2"&gt;&lt;br&gt;
  Third number: &lt;input type="number" name="param3"&gt;&lt;br&gt;
  &lt;input type="submit" value="submit" /&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>And here is the little bit I have for the node.js file:</p>
  
  <pre><code>var http = require('http');
  var math = require('mathjs');
  
      var m = 3;
      var n = 5;
      var o = 7;
      var p = 2;
  
  http.createServer(function(req,res) {
  
  function pleaseSolve () {
  
      var comp = math.chain(m)
      .add(m)
      .divide(p)
      .multiply(o)
      .done();
  
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end("The answer is " + comp);
  
  }
  
  pleaseSolve();
  
  }).listen(8080);
  </code></pre>
  
  <p>Instead, I would like a method or something similar that would assign those variables using input from the HTML form rather than me simply hard-coding them.</p>
  
  <p>EDIT: I've already been downvoted and I have been searching the web for two days for an answer for this and I haven't found one. Please be constructive and at least link another post versus downvoting and being non-constructive.</p>