title: How to use Angular ngRoute with NodeJS
body: <p>I' trying to get AngularJS routes working with my NodeJS http server. I have the following code:</p>
  
  <p><strong>server.js:</strong></p>
  
  <pre><code>app.set('port', 3000);
  app.use(express.static(__dirname));
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());
  app.get('/menuItems', menu.getMenuItems);
  httpServer.listen(app.get('port'), function () {
      console.log("Express server listening on port %s.", httpServer.address().port);
  });
  </code></pre>
  
  <p><strong>app.js:</strong></p>
  
  <pre><code>var app = angular.module('app', ['ngRoute']);
  app.config(['$routeProvider',
      function($routeProvider) {
          $routeProvider.
              when('/cases', {
                  templateUrl: '../templates/cases.html'
              }).
              otherwise({
                  templateUrl: '../index.html'
              });
      }]);
  </code></pre>
  
  <p>but no matter what I try to do I get "Cannot GET /cases".</p>
  
  <p>I could set up all my routes in node.js but would prefer not to.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>I have looked at this post: <a href="https://stackoverflow.com/questions/13222252/how-to-use-angularjs-routes-with-express-node-js-when-a-new-page-is-requested">How to use AngularJS routes with Express (Node.js) when a new page is requested?</a> but still don't get it :-(</p>