Answer the question
In order to leave comments, you need to log in
What about relative paths to images?
Hello everyone, people help pliz.
I use express
The image is physically located in public/images/1.jpg
In the html markup, I have the following path <img src="images/1.jpg">
127.0.0.1:4000 - the image is displayed (the image refers to 127.0.0.1:4000/images/1.jpg)
127.0.0.1:4000 /category/12321 - the picture is not displayed (the picture refers to 127.0.0.1:4000/category/images/1.jpg)
app.use(express.static(path.join(__dirname, 'public'))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question