简体   繁体   中英

Image loading locally but not on heroku server

My code works fine on local deployment, but when uploaded to a heroku server, I get the error message "Failed to load resource: the server responded with a status of 404 (Not Found)" in relation to howling.jpg. Checking the directory with bash shows that the image is on my heroku server to be used but I can't figure out why it won't load it. My canvas in the html file loads without an issue.

html code of image

heroku bash displaying howling.jpg

Did you reference howling.jpg with a relative reference in your code?

If you used an absolute path the directory names may be different and you might not be able to locate your image.

What is your code that is accessing/calling the image location? can you post it here please

通过放入图像文件夹并使用app.use 固定代码进行固定

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM