Search code examples
google-app-enginegoogle-cloud-platformgoogle-cloud-functions

Google Cloud functions Java 11 - How to Debug locally ? Avoid the need of re deploy with logs


I am using intellij IDE and maven project.

To debug cloud function, every time I need to Re-deploy with SYSO logs and taking 2 mins to upload.

Do we have any mechanism run JAVA GCP cloud functions locally so we can fast development and debug process ?


Solution

  • You can run locally your function thank to the Function Framework and Maven

    mvn function:run
    

    This create a local webserver that listen on the port 8080. Curl it to test it

    curl localhost:8080
    
    curl -X POST -d "my data" localhost:8080