I have a route setup in AngularJS that looks something like this:
$routeProvider
.when('/aaa/bbb', {
templateUrl: 'app/aaa/aaa.html',
controller: 'AaaCtrl'
});
Now whenever a user visits /aaa/bbb the user should only be able to visit if the user is logged in, otherwise the user should be redirected to /login. After login in the user should be redirected to /aaa/bbb as originally requested.
I know this is possible to do with connect-ensure-login but I don't understand how to setup the routing with Express? In Express all my routes are setup to be /api routes not the routes the end-user are visisting like /aaa/bbb