title: Static routing in node express
body: <p>Im using a set of static routes in Node Express and are experiencing a very strange phenomenon.</p>
  
  <p>The routing is set up so that <code>'/list/*'</code> and <code>'/setup/*'</code> gets to different html-files where the directories are used kind of as storage id, for example updating info on the page <code>url/setup/12345</code> would store info in <code>12345</code>. </p>
  
  <p>To be able to load scripts and such there is also route with regex matching <code>/assets/</code> to allow <code>url/setup/assets/script.js</code> to be reached without routing to <code>setup.html</code> with a new storage id.</p>
  
  <p>My problem is that this works for <code>url/setup/assets/script.js</code> but not for <code>url/list/assets/script.js</code> even though they have identical routings.  </p>
  
  <hr>
  
  <p>Edit: </p>
  
  <p>Navigating to <code>url/list/assets/script.js</code> leads to <code>list.html</code> (unwanted behaviour)</p>
  
  <p>Navigating to <code>url/setup/assets/script.js</code> leads to <code>script.js</code> (wanted behaviour)</p>
  
  <hr>
  
  <p>Any ideas on why '/list/*'` wont work?</p>
  
  <p>Here are my static routes:</p>
  
  <pre><code>app.use(/assets/, express.static(wwwPath));
  
  app.use('/list/*', function(req, res, next) {
      res.sendFile('list.html', { root: wwwPath });
  });
  
  app.use('/setup/*', function(req, res, next) {
      res.sendFile('setup.html', { root: wwwPath });
  });
  </code></pre>