In my Express app, when the admin sucessfully logs in, I want him to be sent to his dashboard page. So in the post
function, on success, I redirect to admin/
which takes him to the next function
So I have:
adminRoutes.get('/', function(req, res){
console.log("/", path.join(__dirname, 'public/admin/index.html'));
res.sendFile(path.join(__dirname, 'public/admin/index.html'), {}, function (err) {
if (err) {
console.log(err);
res.status(err.status).end();
}
else {
console.log('Sent:');
}
});
});
But the problem is, nothing happens in my browser. It just stays on the browser page. It doesn't change to the new page I'm sending.
Why is it not working?