This sample application demonstrates how to access Compute Metadata from App Engine.
Before running this sample:
- Go to Google Developers Console and create a new project.
-
Install
composer -
Install dependencies by running:
composer install
-
Install the Google Cloud SDK.
-
Initialize the SDK by running
gcloud init
This sample is designed to run in App Engine environment. It will fail to reach the Metadata server if run locally.
Deploy with gcloud
gcloud config set project YOUR_PROJECT_ID
gcloud app deploy
gcloud app browse
The last command will open https://{YOUR_PROJECT_ID}.appspot.com/
in your browser.