I want to create a program that can create HTML pages when requested. The text in the HTML page works well, but I can't use any external CSS or add local images from my computer. I checked and the paths to the images are valid and if I copy paste the HTML code in an HTML file, it works. My problem only applies to local images, since it worked when the images were online. Here is my placeholder code (I'll do my real program after I figure out how I can access local files).
const express = require('express');
const app = express();
app.use(express.json());
app.get('/', (req, res) => {
res.send(`
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href ="ressources/manga.css"/>
<link rel="icon" href="ressources/logo." type="image/x-icon" />
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manga Reader</title>
</head><body><div class="logo">
<img src ="/ressources/logo.gif">
</div><h1>Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files</h1</br>
<a class="n-chap" rel="nofollow" href = "Kondo Wa Korosaretakunai Azarashi-San Chapter 2 - Manganelo_files.html"><i></i> Next Chapter ►►</a><br/></n-chap>
<div class="chapters">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/1-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/2-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/3-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/4-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/5-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/6-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/7-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/8-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/9-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/10-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/11-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/12-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/13-n.jpg">
<img src="Kondo Wa Korosaretakunai Azarashi-San Chapter 1 - Manganelo_files/14-n.jpg">
</div>
<div class="change-chapter">
<a class="n-chap" rel="nofollow" href = "Kondo Wa Korosaretakunai Azarashi-San Chapter 2 - Manganelo_files.html"><i></i> Next Chapter ►►</a><br/></n-chap>
</div>
</body>
</html>
`
);
});
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`listening on port ${port}...`));