Check out the code snippet below:
<!DOCTYPE html>
<html lang="en>
<head>
<meta charset="UTF-8>
<title>Home Page</title>
</head>
<body>
<img src="resources/mainlogo.png" style="width:304px;height:228px;">
<h1>Welcome to our user management application</h1>
<h3>Please see links below to navigate our homepage</h3>
<a href = /adduser>Create new user</a>
<a href = /users>List users</a>
</body>
</html>
Only the image is not being displayed.
Take a look at my file structure:
index.html
resources
mainlogo.png
Any idea what I could be doing wrong?
Snippet of the rendering code:
app.get('/', function (req, res) {
// render main page
res.sendFile(__dirname + "/index.html");
});
Here is the error message from the console:
Error http://localhost:8000/resources/mainlogo.png 404 (Not Found)
The image is located inside the resources folder despite the error.