title: How to use AngularJS routes with Express (Node.js) when a new page is requested?
body: <p>I'm using Express, which loads AngularJS from a static directory.  Normally, I will request <code>http://localhost/</code>, in which Express serves me my <code>index.html</code> and all of the correct Angular files, etc.  In my Angular app, I have these routes setup, which replace the content in an <code>ng-view</code>:</p>
  
  <pre><code>$routeProvider.when('/', {
      templateUrl: '/partials/main.html',
      controller: MainCtrl,
  });
  
  $routeProvider.when('/project/:projectId', {
      templateUrl: '/partials/project.html',
      controller: ProjectCtrl,
  });
  
  $locationProvider.html5Mode(true);
  </code></pre>
  
  <p>On my main page, I have a link to <code>&lt;a href="/project/{{project.id}}"&gt;</code>, which will successfully load the template and direct me to <code>http://localhost/project/3</code> or whatever ID I have specified.  The problem is when I try to direct my browser to <code>http://localhost/project/3</code> or refresh the page, the request is going to the Express/Node server, which returns <code>Cannot GET /project/3</code>.  </p>
  
  <p>How do I setup my Express routes to accommodate for this?  I'm guessing it will require the use of <a href="http://docs.angularjs.org/guide/dev_guide.services.$location" rel="noreferrer"><code>$location</code></a> in Angular (although I'd prefer to avoid the ugly ?searches and #hashes they use), but I'm clueless about how to go about setting up the Express routes to handle this.</p>
  
  <p>Thanks.</p>