I want to display an image on a page in the browser but for some reason it will only display the alt tag (in addition to the ordered list below it). The path to the image is cor
You're actually serving individual files, that's not the right way. For serving static files using Express, use the Express Static server.
app.use(express.static('static'));
And move all the static files into a director named static
. Else, what you might have to do is:
app.get("/test.html", (req, res) => {
res.sendFile("./test.html");
});
app.get("/images/test.jpg", (req, res) => {
res.sendFile("./images/test.jpg");
});