【发布时间】:2014-07-21 23:08:35
【问题描述】:
我希望能够在 Google Cloud Storage 中动态创建存储分区。我正在使用 MEAN.io 堆栈,因此我想在后端的 Node.js 中执行此操作。 我无法找到帮助我的 api,有没有办法做到这一点?
谢谢!
更新:在这里我尝试使用 Google-Node.js api,但没有任何反应。然后我尝试对其进行身份验证,以防出现问题,但我不确定从这里去哪里。
googleAuth.authenticate(
credentials.jwt,
function(err, token) {
if (err) console.log(err);
console.log(token);
googleapis
.discover('storage', 'v1')
.execute(function(err, client) {
if (err) console.log(err);
client.storage.buckets.insert({'project': credentials.project}, {'name': bucketname}).execute();
})
});
【问题讨论】:
标签: node.js google-cloud-storage