j1cs / micronaut-test-spock-poc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Micronaut 3.1.3 Documentation


Micronaut and Google Cloud Function

Running the function locally

./mvnw function:run

And visit http://localhost:8080/functionExample

Deploying the function

First build the function with:

$ ./mvnw clean package

Then cd into the target directory (deployment has to be done from the location where the JAR lives):

$ cd target

Now run:

$ gcloud functions deploy function-example --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 function-example --format='value(httpsTrigger.url)')

You can then use this variable to test the function invocation:

$ curl -i $YOUR_HTTP_TRIGGER_URL/functionExample

Feature google-cloud-function documentation

Feature google-cloud-function-http documentation

Feature lombok documentation

Feature gcp-pubsub documentation

Feature reactor documentation

About


Languages

Language:Batchfile 62.3%Language:Java 21.2%Language:Groovy 16.5%