I have created several Angular routes as illustrated in the code snippet below.
app.config(function($routeProvider, $locationProvider, $provide) {
$routeProvider
.when('/', {
templateUrl: 'home.html',
controller: 'AppCtrl'
});
.when('/portfolio', {
templateUrl: 'portfolio.html',
controller: 'AppCtrl'
})
$provide.decorator('$sniffer', function($delegate) {
$delegate.history = historyCompatCheck();
return $delegate;
});
$locationProvider.html5Mode(true);
});
Everything seems to be working fine. When I set the base href to "/", it accepts an anchor with the href of "/portfolio". However, when I navigate to "" or try to reload the page while on the portfolio route, it results in a server error. Is there a solution to this issue?
Thank you in advance.