D
D
dimachornenkiy2020-01-15 23:47:10
Node.js
dimachornenkiy, 2020-01-15 23:47:10

How to correctly specify the paths for files in localhost?

I launch an express server from the node, it returns on request (routes on port 3000), while the paths to all pictures and other files turn out to be not working.
PySy: relative addresses are indicated if you just open index.html, everything works. I tried to specify the absolute address
localhost:3000/img/chat.png does not work either (in the folder with index.html there is an img folder in it all the pictures)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Kondratsky, 2020-01-17
@dimachornenkiy

express static folder tutor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question