bijukunjummen / http-cloudfunction-java-gradle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample Google Cloud Function using Java and Gradle

Running Locally

./gradlew cloudFunctionRun
curl -v -X "POST" "http://localhost:8080" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d $'{
  "name": "Again"
}'

Deploying the function

# Build the uber jar
./gradlew shadowJar

# Deploy the jar
gcloud beta functions deploy java-http-function \
--gen2 \
--runtime java17 \
--trigger-http \
--entry-point functions.HelloHttp \
--source ./build/libs/ \
--allow-unauthenticated

About


Languages

Language:Java 64.6%Language:HCL 35.4%