title: Angular Ui-Router isn't routing while using node.js
body: <p>I am using angular ui router. The router seems to work perfect on the home page index.html. But any other navigation doesn't work.</p>
  
  <p>Here is my stateprovider angular:</p>
  
  <pre><code>var app = angular.module('myApp', ['ui.router']);
  
  
  app.config(function($stateProvider, $urlRouterProvider) {
      $urlRouterProvider.otherwise("/");
  
      $stateProvider
          .state("home", {
              url: "/",
              templateUrl: "../partials/home/index.html"
          })
          .state("login", {
              url:"/login",
              templateUrl: "../partials/account/login.html"
          })
          .state("register", {
              url: "/register",
              templateUrl: "../partials/account/register.html"
          })
          .state("values", {
              url: "/values",
              templateUrl: "../partials/test/values.html"
          })
      ;
  });
  </code></pre>
  
  <p>HTML in my main index.html:</p>
  
  <pre><code> &lt;!--Content --&gt;
      &lt;div class="container"&gt;
          &lt;div ui-view&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;!-- END Content --&gt;
  </code></pre>
  
  <p>When I navigate the the page localhost:8080/login I get this:</p>
  
  <p><img src="https://i.stack.imgur.com/zqVQA.png" alt="enter image description here">
  I would think I shouldn't even be seeing this page if it can't find it. Shouldn't it redirect me back to "/" because of $urlRouterProvider.otherwise(). Besides that point though the template url /partials/account/login.html Does Exist. </p>
  
  <p>I am somewhat new to node.js and I am curious if the note file server is trying to route and trumping my angular one? I am using http-server which is probably the most common one.</p>
  
  <p>I am also using Express Node if that helps. And here is the code for app.js where I think the problem may be coming from:</p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var favicon = require('static-favicon');
  var logger = require('morgan');
  var cookieParser = require('cookie-parser');
  var bodyParser = require('body-parser');
  
  var routes = require('./routes/index');
  var users = require('./routes/users');
  
  var app = express();
  
  // view engine setup
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'jade');
  
  app.use(favicon());
  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded());
  app.use(cookieParser());
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.use('/', routes);
  app.use('/users', users);
  
  /// catch 404 and forward to error handler
  app.use(function(req, res, next) {
      var err = new Error('Not Found');
      err.status = 404;
      next(err);
  });
  
  /// error handlers
  
  // development error handler
  // will print stacktrace
  if (app.get('env') === 'development') {
      app.use(function(err, req, res, next) {
          res.status(err.status || 500);
          res.render('error', {
              message: err.message,
              error: err
          });
      });
  }
  
  // production error handler
  // no stacktraces leaked to user
  app.use(function(err, req, res, next) {
      res.status(err.status || 500);
      res.render('error', {
          message: err.message,
          error: {}
      });
  });
  
  
  module.exports = app;
  </code></pre>