NodeJs - Loopback : How to upload file on google cloud storage

杀马特。学长 韩版系。学妹 提交于 2020-01-03 03:10:10

问题


In loopback framework, we have a module LoopBack Storage Component. It's support for many clouds except Google Cloud Storage. But I have to use Google Cloud.


回答1:


It should support Google out of the box because it uses pkgcloud lib which has support for Google Cloud. Try simply adding a config entry to the providers.json file.

For more info on how to do that check Loopback storage component documentation and also pkgcloud config format for Google Cloud.

I'd just try something like this in the providers.json:

{
    "google": {
        "keyFilename": "/path/to/a/keyfile.json",
        "projectId": "your-project-id"
    }
}


来源:https://stackoverflow.com/questions/30022591/nodejs-loopback-how-to-upload-file-on-google-cloud-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!