title: Express-js wildcard routing to cover everything under and including a path
body: <p>I'm trying to have one route cover everything under <code>/foo</code> including <code>/foo</code> itself. I've tried using <code>/foo*</code> which work for everything <em>except</em> it doesn't match <code>/foo</code>. Observe:</p>
  
  <pre><code>var express = require("express"),
      app = express.createServer();
  
  app.get("/foo*", function(req, res, next){
    res.write("Foo*\n");
    next();
  });
  
  app.get("/foo", function(req, res){
    res.end("Foo\n");
  });
  
  app.get("/foo/bar", function(req, res){
    res.end("Foo Bar\n");
  });
  
  app.listen(3000);
  </code></pre>
  
  <p>Outputs: </p>
  
  <pre><code>$ curl localhost:3000/foo
  Foo
  $ curl localhost:3000/foo/bar
  Foo*
  Foo Bar
  </code></pre>
  
  <p>What are my options? The best I've come up with is to route <code>/fo*</code> which of course isn't very optimal as it would match way too much.</p>