简体   繁体   English

在 next.js 中制作后不显示照片

[英]don't show photos after production in next.js

I made an application with Next.js and used node.js in the api part.我使用 Next.js 制作了一个应用程序,并在 api 部分使用了 node.js。 I had no problems using it on my own computer, but when I run it on my server in digitalocean, the photos I uploaded from the administration panel are not shown.我在自己的电脑上使用它没有问题,但是当我在我的服务器上运行它时,我从管理面板上传的照片没有显示。 When I check the database and directory, there is no problem.当我检查数据库和目录时,没有问题。 The photo is being recorded there.照片正在那里记录。 section is correct when I enter the site and check it.当我进入网站并检查它时,部分是正确的。 When I wear path / file.jpg it gives 404 error.当我穿 path / file.jpg 时,它会出现 404 错误。

There is no problem in the previous recordings and it shows the photos.之前的录音没有问题,显示照片。 The photos do not show after running on the server.在服务器上运行后不显示照片。

I made folder permissions 777, but nothing else came to my mind.我将文件夹权限设置为 777,但我没有想到其他任何东西。 I didn't add code because I didn't think there was a problem with the code.我没有添加代码,因为我认为代码没有问题。

我解决了这个问题:在API中定义express静态文件后,它开始工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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