title: Node express GET route fails every other request when wildcard match
body: <p>I have a router setup to accept any GET request that doesn't match the word "API" in it.  This is for my single page app so that any bookmarked urls my javascript can't use its routes for.</p>
  
  <p>The problem is every other time I refresh the page with a test url it fails.</p>
  
  <p>URL: <a href="http://localhost:3000/my-test-url" rel="nofollow">http://localhost:3000/my-test-url</a></p>
  
  <p>First time hitting url, my index page loads.</p>
  
  <p>Second time refreshing the page, error.</p>
  
  <p>Cannot GET /my-test-url</p>
  
  <p>Third time hitting refresh it works, and fourth time fails, and so on.</p>
  
  <pre><code>app.engine('html', cons.underscore);
  app.set('view engine', 'html');
  app.set('views', path.resolve(__dirname, '../client'));
  
  // serve static content for the app from the "client" directory in the     application directory
  //express.static(path.join(__dirname, '../client')))
  app.get(/^(?!.*\bapi\b).*$/ig, function(req, res) {
      res.render('index');
  });
  
  app.listen(app.get('port'), function() {
      console.log('Server up: http://localhost:' + app.get('port'));
  });
  </code></pre>
  
  <p>Is there something that keeps the request open after it works the first time?  The network tab in the browser shows the same URL each time but alternating with 404 error.  Any suggestions are appreciated.</p>
  
  <p>Update, there does seem to be an issue maybe not with the Regex, but how the router interprets it each time.  When I set a route like this:</p>
  
  <pre><code>app.get('*', function(req, res) {
      console.log(req.route);
      res.render('index');
  });
  </code></pre>
  
  <p>It seems to work every time, as I would expect.</p>