Having an issue with angularjs ngRoute for routing a single page application. When attempting to reload the page at localhost/about or localhost/blog, I receive an error message stating "Cannot GET /about". How can this be resolved?
Below is my router configuration:
var myApp = angular.module('myApp',['ngRoute']);
myApp.config(['$locationProvider','$routeProvider',function($locationProvider,$routeProvider){
$locationProvider.html5Mode(true);
$routeProvider
.when('/',{
templateUrl: 'views/pages/home.html',
controller: 'homeCtrl'
})
.when('/about',{
templateUrl: 'views/pages/about.html',
controller: 'aboutCtrl'
})
.when('/contact',{
templateUrl: 'views/pages/contact.html',
controller: 'contactCtrl'
})
.when('/blog',{
templateUrl: 'views/pages/blog.html',
controller: 'blogCtrl'
})
.otherwise({redirectTo: '/home'});
}]);
Solely utilizing Angular for this setup.