When I click on the login link then I go to the to /login. Which looks like this link to screenshot:
Notice the response Session not found
When you refresh the page at /login, the call for this URI is made on the backend and as you can see you don't support handling that route there. The code you put was correct, but you have to place it below all your route handlers. So place:
app.route('/*').get(function(req, res) {
return res.sendFile(path.join(__dirname, 'public/index.html'));
});
Below the lines:
app.use('/', index);
app.use('/api/auth', require('./controllers/AuthController'));
app.use('/api/v1/', projects);
Now the frontend will be loaded for every URI that isn't explicitly defined in the backend, which makes it possible for you to still use your backend API calls. Just make sure the frontend and backend don't use the same URI's.