I'm currently in the process of learning how to develop websites, but I've encountered a stumbling block that I can't seem to overcome. I'm hoping someone here can help me out. I'm facing an issue where I am unable to link either a CSS file or an image for the site icon. However, if I use , it seems to work just fine. For my backend, I'm using Node.Js and for the frontend, I'm leveraging EJS.
Here's how I've been trying to connect images:
<!DOCTYPE html>
<html lang="eng">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="32x32" href='src/images/favicon-32x32.png'>
<title>Title</title>
And this is what I have for linking the CSS file:
<link rel="stylesheet" type="text/css" href="./style.css">
</head>
<body>
<h1 class="ws_title">Title</h1>
Both my css file and html template reside in the same directory: src/views/project The images are located under src/images
I've attempted using different browsers, but unfortunately, the issue persists.
Any ideas on what could be causing this problem?
Update: After some further investigation, I discovered that with EJS, I need to utilize express.static. Could someone provide guidance on how to proceed with this?