HTTP Google Cloud Functions in Go
- In the Cloud Console, in the top right toolbar, click the Activate Cloud Shell button.
- Ensure the Cloud Functions API is enabled
gcloud services enable cloudfunctions.googleapis.com
- Download and setup the code
curl -LO https://github.com/GoogleCloudPlatform/golang-samples/archive/main.zip unzip main.zip cd golang-samples-main/functions/codelabs/gopher tree
- Deploy this function as an HTTP Cloud Function!
gcloud functions deploy HelloWorld --runtime go111 --trigger-http
- Copy the Cloud Function URL and open in browser
Tag:Google Cloud