This sample demonstrates how to use Google Cloud Storage on Google App Engine Managed VMs.
Before you can run or deploy the sample, you will need to do the following:
-
Enable the Cloud Storage API in the Google Developers Console.
-
Create a Cloud Storage Bucket. You can do this with the Google Cloud SDK with the following command:
gsutil mb gs://<your-bucket-name>
-
Set the default ACL on your bucket to public read in order to serve files directly from Cloud Storage. You can do this with the Google Cloud SDK with the following command:
gsutil defacl set public-read gs://<your-bucket-name>
-
Update the environment variables in
app.yaml
.
Refer to the top-level README for instructions on running and deploying.
When running locally, you can use the Google Cloud SDK to provide authentication to use Google Cloud APIs:
gcloud init
Then set environment variables before starting your application:
export GCLOUD_PROJECT=<your-project-id>
export GCLOUD_STORAGE_BUCKET=<your-bucket-name>
npm install
npm start