title: Concatenate express route parameter and file extension
body: <p>In my Express app I create snapshots whose details I store in MongoDB. The actual snapshot files are stored in the snapshots folder under their _id, eg <code>/snapshots/575fe038a84ca8e42f2372da.png</code>. </p>
  
  <p>These snapshots can currently be loaded by a user by navigating to the folder and id, in their browser, i.e. <code>/snapshots/575fe038a84ca8e42f2372da</code>, which returns the image file. However I think to be more intuitive the url path should include the file extension; i.e. the user should have to put in <code>/snapshots/575fe038a84ca8e42f2372da</code> <strong><code>.PNG</code></strong> to get the file. </p>
  
  <p>This is what I have currently:</p>
  
  <pre><code>router.get('/:shotID', function(req, res, next) {
  
      // Checks if shot exists in DB
      Shots.findOne({
          _id: req.params.shotID // More conditions might get put here, e.g. user restrictions
      }, (err, result) =&gt; {
          if (err) {
              res.status(404).res.end();
              return;
          }
          var file = fs.createReadStream(`./snapshots/${req.params.shotID}.png`);
  
          file.pipe(res);
      });
  });
  </code></pre>
  
  <p>How can I incorporate the user putting in the file extension in this path?</p>