Pull images in HTML with Node Js + Express

Asked

Viewed 378 times

0

Guys I’m starting with the nodejs and I have a question. Whenever I call ima image or even the bootstrap in my file I have to use sendfile. Whenever u by an icon or image I will have to set the route in the Node and then in the file, or there is a more practical way for it?

  • If you map the public folder in express and add your image in this folder, you access it from html without sending.

  • Please send us your line of code to show this icon and/or image, when I want to upload some image I just do it this way: <img src="/public/img/image.jpg" />

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.