title: Express: Optional trailing slash for top-level path
body: <p><strong>Update:</strong> My question did not accurately convey what I'm trying to achieve. I wish to match <code>/foo</code>, <code>/foo/</code>, and anything under <code>/foo/</code> (e.g. <code>/foo/asdf/jkl</code>), not the given paths specifically. The original question follows.</p>
  
  <hr>
  
  <p>I'd like to match the following paths:</p>
  
  <pre><code>/foo
  /foo/bar
  /foo/bar/baz
  </code></pre>
  
  <p>These should work, too:</p>
  
  <pre><code>/foo/          -&gt;  /foo
  /foo/bar/      -&gt;  /foo/bar
  /foo/bar/baz/  -&gt;  /foo/bar/baz
  </code></pre>
  
  <p>I tried the following:</p>
  
  <pre><code>app.get('/foo/*', ...);
  </code></pre>
  
  <p>This fails in the <code>/foo</code> case, though. I know that I can provide a regular expression rather than a string, but this is surely a common requirement so I'd be surprised to learn that the pattern-matching DSL does not accommodate it.</p>