I have used the great plugin edgee:slingshot to upload files to GoogleCloud Storage. The files are not public accessible (and should not be). But how can I load the images now in Meteor?
I would like to load them directly from the client, so that I don’t loop the traffic through the server.
I have not found any good solution yet and would be thankful for a hint Did anyone solve this problem already?
Slingshot.GoogleCloud.directiveDefault.GoogleAccessId = “Enter your access id (it looks like an email address)”;
Slingshot.GoogleCloud.directiveDefault.GoogleSecretKey = Assets.getText(‘google-cloud-service-key.pem’);
My other issue was that I didn’t was to save the .pem file in private, as the code would be public using github to push the code to Heroku. My solution to this was to save AccessId and SecretKey as environment variables and use process.env.ENVIRONMENT_VARIABLE_NAME to get the values, like:
Slingshot.GoogleCloud.directiveDefault.GoogleAccessId = process.env.GOOGLE_ACCESS_ID;
Slingshot.GoogleCloud.directiveDefault.GoogleSecretKey = process.env.GOOGLE_SECRET_KEY;