title: AngularJS and Express routing 404
body: <p>I have a following AngularJS app:</p>
  
  <pre><code>angular.module('app', ['ngRoute', 'app.controllers'])
  .config(['$routeProvider', function($routeProvider){
      $routeProvider
          .when('/', {
              controller: 'HomeController',
              templateUrl: 'views/home.html'
          })
          .when('/garage', {
              controller: 'GarageController',
              templateUrl: 'views/vehicle.html'
          })
          .otherwise({
              redirectTo: '/'
          });
  }])
  .config(['$locationProvider', function($locationProvider) {
      $locationProvider.html5Mode(true);
  }]);
  </code></pre>
  
  <p>Node.js is my backend and its only purpose is to provide REST api (which is not implemented yet). Express configuration is as follows:</p>
  
  <pre><code>app.use(express.static(path.join(__dirname, 'public')));
  
  app.get('*', function(req, res) {
     res.sendFile(__dirname + '/public/index.html');
  });
  </code></pre>
  
  <p>The problem is that whenever I put some invalid url in the address bar, like         <code>http://localhost:3000/abc</code> request reaches the server. I assumed, that it should be handled by AngularJS routing and redirected to default '/' page. Why is that not happening?
  When that happens, all aplication is downloaded once again, all index and assets files. I would like to tell AngularJS - whenever somebody enters an invalid route, just route to the default one. And this should just replace ng-view, rather than downloading whole index.html once again. Is that possible?</p>
  
  <p>Thanks</p>