Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 1.12 KB

File metadata and controls

67 lines (44 loc) · 1.12 KB

Java: Cloud Functions - hello-http

An HTTP triggered Java Cloud Functions template.

Test locally

Compile:

mvn compile

Run the function:

mvn function:run

...
INFO: Serving function...
Mar 01, 2023 12:57:13 PM com.google.cloud.functions.invoker.runner.Invoker logServerInfo
INFO: Function: functions.Function
Mar 01, 2023 12:57:13 PM com.google.cloud.functions.invoker.runner.Invoker logServerInfo
INFO: URL: http://localhost:8080/

Inside the scripts folder, run test_local.sh to test the function locally:

./test_local.sh

Hello World!

Before deploying to Google Cloud

Run setup.sh to enable required services:

./setup.sh

Deploy to Google Cloud

Run deploy.sh to deploy to Google Cloud:

./deploy.sh

Test in Google Cloud

You can test with Invoke function via HTTP in Cloud Code or with gcloud.

Run test_cloud.sh to test the function in Google Cloud:

./test_cloud.sh

Cleanup

When you're done, you can cleanup created resources:

./cleanup.sh