Relative Content

Tag Archive for javascripthtmlnode.jsexpress

images wont load (html, javascript, node.js, express)

Im working on a project and the user uploads their images (path is saved in mysql) and the image itself is saved in a directory named uploads. I have my html css and js files stored in /var/www/html and my node.js file in /var/www/example/server.js and my uploads directory in /var/www/example/uploads. Ive been troubleshooting for hours and even asked chatgpt and i cant figure out what this issue is. ive tried changing the path, chmod 755, adding stuff to the apache config and the .htaccess, and probably more. i verified that these images exist and that they load properly when adding them to a straight up html page. i have no idea what im doing wrong. the node server file and the uploads directory are both stored in the same directory. but i still keep getting this error in console: