./gradlew runFunction
And visit http://localhost:8080/cloudFuncDemo
First build the function with:
$ ./gradlew clean shadowJar
Then cd
into the build/libs
directory (deployment has to be done from the location where the JAR lives):
$ cd build/libs
Now run:
$ gcloud functions deploy cloud-func-demo --entry-point io.micronaut.gcp.function.http.HttpFunction --runtime java11 --trigger-http
Choose unauthenticated access if you don't need auth.
To obtain the trigger URL do the following:
$ YOUR_HTTP_TRIGGER_URL=$(gcloud functions describe cloud-func-demo --format='value(httpsTrigger.url)')
You can then use this variable to test the function invocation:
$ curl -i $YOUR_HTTP_TRIGGER_URL/cloudFuncDemo/pret
or:
$ curl -i $YOUR_HTTP_TRIGGER_URL/cloudFuncDemo/micronaut