code: function handlePost(req, res) {
    var length = parseInt(req.headers['content-length'], 10);
    if (length <= 0) {
      res.end();
      return;
    }
  
    var filename = req.headers['x-filename'] || 'save-trace.wtf-trace';
    var writable = fs.createWriteStream(filename, {flags: 'w'});
  
    req.on('data', function(chunk) {
      writable.write(chunk);
    });
  
    req.on('end', function() {
      console.log(filename);
      writable.end();
      res.end();
    });
  }
docs: Save the posted trace file to local directory.