title: In node js how to connect the post method while submitting form
body: <p>this is my form how can i connect with node js.while submitting this form</p>
  
  <pre><code>&lt;form id="fileupload" action="/file-upload" method="POST" enctype="multipart/form-data"&gt; 
  &lt;input id="fileToBeUploaded" type="file" name="thumbnail"&gt;
  &lt;input type="submit" value="upload"&gt; 
  &lt;/form&gt; 
  </code></pre>
  
  <p>server side</p>
  
  <pre><code>var http = require("http");
  var url = require("url");
  
  http.createServer(function(req, res) {
    switch (url.parse(req.url).pathname)
    { 
      case '/': console.log('server side methodcalled'); 
        break;
      case '/file-upload': console.log('server side method called');
        break; 
      default: 
        console.log('server side method called');
        break;
    }
  }); 
  </code></pre>