问题
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