title: Node.js: get path from the request
body: <p>I have a service called "localhost:3000/returnStat" that should take a file path as parameter. For example '/BackupFolder/toto/tata/titi/myfile.txt'.</p>
  
  <p>How can I test this service on my browser?
  How can I format this request using Express for instance?</p>
  
  <pre><code>exports.returnStat = function(req, res) {
  
  var fs = require('fs');
  var neededstats = [];
  var p = __dirname + '/' + req.params.filepath;
  
  fs.stat(p, function(err, stats) {
      if (err) {
          throw err;
      }
      neededstats.push(stats.mtime);
      neededstats.push(stats.size);
      res.send(neededstats);
  });
  };
  </code></pre>