I'm trying to return an html to user when a request is completed, like this:
router.get('/reset-password/:TOKEN', function(req, res) {
Users.someStuff(req.params.TOKEN, function (error, result) {
if (result) {
res.sendfile('./views/passwordReset.html', {root: __dirname })
}
else {
res.status(500).json(error);
}
});
});
My html is described like this
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Service</title>
</head>
<body>
<img src="/views/assets/img/logo.png">
</body>
</html>
The path of the image is absolute path from the html file
The problem is that the image is not showed when the html is rendered
What I'm doing wrong?