【问题标题】:keystone.Storage adaptor for google cloud storage谷歌云存储的 keystone.Storage 适配器
【发布时间】:2020-09-02 17:32:41
【问题描述】:

keystone.Storage 库是否有谷歌云存储适配器?

我想通过一个服务提供商托管我所能做的一切。我将使用谷歌云平台来托管我的 Keystone.js 应用程序和 MongoDB 数据库。

该库有一个本地文件、S3 和 Azure 的适配器,但我不知道如何将它与谷歌云存储一起使用。

https://github.com/keystonejs/keystone/tree/master/lib/storage

如果它可以像keystone-storage-adapter-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 字段的存储提供程序:

File.add({
  name: { type: String },
  file: { type: Types.File, storage: storage },
});

【问题讨论】:

    标签: node.js mongodb google-cloud-storage keystonejs


    【解决方案1】:

    您应该查看 GCP Adapter 以获得 Keystone。它不是 Keystone 的正式组成部分,但它使用的格式与您描述的格式接近。

    我知道这个问题被问到已经有一段时间了,所以我假设你设法解决了这个问题。为了那些追求这个答案的人,我离开了这个。希望对您有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-10
      • 2016-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多