Cloud Functions
Deploy a simple HTTP function.
Last updated
Was this helpful?
Was this helpful?
cd $HOME
git clone https://github.com/GoogleCloudPlatform/java-docs-samples
cd java-docs-samples/functions/helloworld/helloworldmvn packagemvn function:run
# In a different tab, trigger the function:
curl localhost:8080gcloud services enable cloudfunctions.googleapis.comgcloud functions deploy helloworld --trigger-http \
--runtime=java11 \
--entry-point=functions.HelloWorld \
--allow-unauthenticatedgcloud functions describe helloworld --format='value(httpsTrigger.url)'URL=$(gcloud functions describe helloworld --format='value(httpsTrigger.url)')
curl ${URL}gcloud functions call helloworldgcloud functions deploy helloworld --trigger-http \
--runtime=java11 \
--memory=512M
--entry-point=functions.HelloWorld \
--allow-unauthenticated