-2

When I open my html in a browser, my image displays fine, but when I run the node server and try to view it at the port, the image is not loading.

The path is correct (it's working when I just view in a browser).

How can I display the image normally at the port?

Thanks

Soluble Snake
  • 73
  • 1
  • 12

1 Answers1

-1

Your question is a little broad, but I'm giving it a shot. You need to install different webpack loaders in order to render images to the webpage.

Image-webpack: https://github.com/tcoopman/image-webpack-loader

You can configure css, raw, json, file loaders in webpack.config.js. Also you'll need to take care of relative paths in webpack, read this.

Indeed, my answer is incomplete, but for brevity I have given you a direction to look into. Hope it helps! Good luck.

Community
  • 1
  • 1
Mihir
  • 3,812
  • 3
  • 25
  • 29
  • At least leave a comment before you down-vote my answer -_- So that I can improve my answers next time! – Mihir May 18 '17 at 06:48