I am trying to display view by using dynamic routing. For this I am using ":"
notation. Once data comes back from the server, $location.path('/postuser/'+permalink) is used to redirect to the view. But for some reason I am getting 404 error.
I am using Html 5 mode. I think this the issue.
$location.path('/postuser/'+permalink) sends request to the server:
instead of this
Here is the router sample
test.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/welcome', {templateUrl: 'partials/welcome.html', controller: 'welcomeController'});
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'singupController'});
$routeProvider.when('/signup', {templateUrl: 'partials/signup.html', controller: 'singupController'});
$routeProvider.when('/', {templateUrl: 'partials/home.html', controller: 'homeController'});
$routeProvider.when('/create', {templateUrl: 'partials/new.html', controller: 'CrudController'});
$routeProvider.when('/user/:permalink', {templateUrl: 'partials/userspostpage.html', controller: 'CrudController'});
$routeProvider.otherwise({redirectTo: '/'});
}]);
test.config(['$locationProvider', function($locationProvider) {
$locationProvider.html5Mode(true);
}]);
AngularJS files and folder structure

Also in back end I am using ExpressJS router
ExpressJS router
app.get("/postuser/:permalink", daataN);
if I remove /:permalink from the $routeProvider I am able to get the response. But I want url to be dynamic
Please let me know what is the issue here