express node.js

node-express too many redirects

I’ve got my routes set up like below

When i navigate to ‘http://localhost/‘ i get an error saying ‘localhost redirected you too many times’ and the URL of the page (showing in the URL bar of the browser) is http://localhost/!/dashboard – so it does look like it is being redirected, but i cannot see why it’s getting stuck in an infinite loop

 // Public Routes
app.use('/', function(req,res){
app.use('/login', routes.login);
app.use('/!/dashboard', isLoggedIn, routes.dashboard);
// Check If Logged In
function isLoggedIn(req,res,next){
if (req.isAuthenticated()){
return next();
} else {