title: Can't get second level routes working in express
body: <p>I'm sorry I'm reasonably new to node. I've been stuck on this for a couple hours.</p>
  
  <p><strong>server.js</strong></p>
  
  <pre><code>app.use(express.static(__dirname + "/public"));
  
  app.get('/', function(req, res){
    res.sendFile(path.resolve(templatesPath + 'index.html'));
  });
  
  app.get('*', function(req, res){
    res.sendFile(path.resolve(templatesPath + 'index.html'));
  });
  </code></pre>
  
  <p>index.html is an Angular application. I have the first level of routes working fine using Angular's HTML5 routes eg. "<a href="http://lh:3000/staff" rel="nofollow">http://lh:3000/staff</a>" or "<a href="http://lh:3000" rel="nofollow">http://lh:3000</a>"</p>
  
  <p>but if I add another level or route parameters, e.g. "<a href="http://lh:3000/staff/" rel="nofollow">http://lh:3000/staff/</a>" or "<a href="http://lh:3000/staff/test" rel="nofollow">http://lh:3000/staff/test</a>" Express seems to ignore express.static and instead uses the get wildcard to turn all my files into index.html so my page breaks.</p>
  
  <p><strong>Thanks for your help answerers</strong></p>
  
  <p>In secondary routes, it was loading assets referenced in index.html, relative to the secondary route. My temp solution is to add:
  app.use('/files/',express.static(path.join(__dirname + "/public")));
  but I realise now it is better to change my solution.</p>