As a newcomer to express.js, I created a project using express.js where the CSS file is located in the public folder and the HTML files are in the views folder. However, when I started the web server, the HTML file rendered successfully but it failed to load any CSS files or images. This led me to believe that there may be an issue with express.js. To test this theory, I ran the HTML file with its path and it worked as expected.
Below is the code snippet from 'main.js':
// Main.js content goes here
...
Here is a segment of the 'index.html' file:
<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
...
<p class="quote">A perfect moderation and fun bot<br>for your Discord Server</p>
...
</script>
...
</body>
</html"
And finally, the 'style.css' section:
*{
margin: 0;
padding: 0;
}
@import url('https://fonts.googleapis.com/css?family=Archivo:400,700');
...
@media screen and (max-width: 640px){
...
}