title: simple express json parser
body: <p>trying to copy a simple example but still cannot parse json post request,
  ideas?
  looking in the borwser (firefox) network tab, I see the request with json params.
  but the server log comes out empty.</p>
  
  <p>client</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;script type="text/javascript"&gt;
  
          var man = {
            name:'name',
            fam:'familiy'
          };
  
    var xhttp = new XMLHttpRequest();
    var url = "http://localhost:8080/";
    xhttp.open("post", url, true);
    xhttp.send(JSON.stringify(man));
  
      &lt;/script&gt;
      &lt;title&gt;Json Test&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      Json Test
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>server</p>
  
  <pre><code>//require the express nodejs module
  var express = require('express'),
      //set an instance of exress
      app = express(),
      //require the body-parser nodejs module
      bodyParser = require('body-parser'),
      //require the path nodejs module
      path = require("path");
  
  
  
  //support parsing of application/json type post data
  app.use(bodyParser.json());
  
  app.post('/', function(req, res){
    res.setHeader('Content-Type', 'application/json');
      console.log(req.body);
      res.send("done");
  });
  
  
  //Start listen on port
  const port = 8080;
  app.listen(port);
  console.log("Node js listen on port " + port + "...");
  </code></pre>