I want to get a picture of '7.jpg', which is stored in the root folder of the server on node.js (along with the main file main.js).

I address from the client on react.js so:

<img src={ `http://localhost:8080/7.jpg` } /> 

I get the error: 404 NOT FOUND.

Tell me, please, what am I doing wrong?

  • Look at the server in the logs, where it is addressed, why it does not find it. Maybe the routes are not configured, etc. Error 404 gives the server, not the application - Dmitry Kozlov

0