是否有适用于Keystone的Google云存储适配器。存储库?
我想通过一个服务提供商托管我能做的一切。我将使用谷歌云平台来托管我的Keystone.js应用程序和MongoDB数据库。
该库有一个用于本地文件,S3和Azure的适配器,但我不知道如何将其与Google云存储一起使用。
请参阅 https://github.com/keystonejs/keystone/tree/master/lib/storage
如果它可以像梯形存储适配器-s3 一样使用,我会很棒:
配置:
var storage = new keystone.Storage({
adapter: require('keystone-storage-adapter-gcloud'),
s3: {
key: 'gcloud-key',
secret: 'secret',
bucket: 'mybucket',
path: '/profilepics',
headers: {},
},
schema: {
bucket: true,
etag: true,
path: true,
url: true,
},
});
然后将其用作文件字段的存储提供程序:
File.add({
name: { type: String },
file: { type: Types.File, storage: storage },
});
您应该查看 Keystone 的 GCP 适配器。它不是Keystone的正式组成部分,但它的使用格式与您描述的格式非常接近。
我知道自从问这个问题以来已经有一段时间了,所以我假设你设法解决了这个问题。我离开这里是为了那些在这个答案之后的人。希望它有帮助!