I want to be able to dynamically create buckets in Google Cloud Storage. I am using the MEAN.io stack, so I want to do this in Node.js on my backend. I'm having trouble finding apis to help me, is there a way to do this?
Thanks!
UPDATE: Here I've tried using the Google-Node.js api, but nothing is happening. I tried to then authenticate it in case that's the problem, but I'm not really sure where to go from here.
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();
})
});