If you don’t already know, uploadfs
is the module that powers cloud media storage for Apostrophe. By default it uses local files, but you can easily configure it to use azure blob storage or Amazon S3.
Now we also have Google Cloud Storage support. Here is an example:
// in app.js
const apos = require('apostrophe')({
modules: {
'apostrophe-attachments': {
uploadfs: {
backend: 'gcs',
bucket: 'yourownbucketnamefromgcs',
region: 'us-east1'
}
}
}
});
IMPORTANT: you must ALSO set the GOOGLE_APPLICATION_CREDENTIALS
environment variable to the location of a project credentials file downloaded from Google Cloud Platform.
Also, your GCS bucket must have object ACLs turned on.
“How do I upgrade to get this feature?” Just type
npm update
. In this case apostrophe itself isn’t being updated but its dependency,uploadfs
, automatically will be thanks to semantic versioning rules.
Thanks to Nick Bauman for contributing this feature.