我正在尝试上传存储在 MongoDB 中的图像。
{ '_id': 1, 'type': 'shirt', 'price': 20, 'pic': 'https://imgur.com/6D53pAF'}
错误表明我的 next.config.js 未正确配置,但它的配置完全按照建议的方式进行。
module.exports = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "imgur.com",
port: '3000',
pathname: ""},
],
},
}
我做错了什么或者有更好的方法吗?
我最初将图像存储在我的 github 项目的问题部分中,并且它有效,但是一旦我更改数据库,它将不再提取图像。
尝试
images: {domains: ['imgur.com'],}