What is the advantage of using GCP Functions Framework when testing locally vs direct invocation?

245 Views Asked by At

I have two components to my backend. A node.js microservice, and a bunch of GCP cloud functions written in node.js, that are called from the microservice.

I want two test these two components locally.

Is there any advantage to using the Functions Framework to have the node.js microservice call to the Function Framework hosting endpoints, as opposed to having the microservice just directly invoke the cloud functions with direct calls (when in local dev debug mode)?

Would my functions behave any differectly when hosted using the functions framework?

1

There are 1 best solutions below

2
On

The function framework allow you to serve an HTTP endpoint locally and to invoke the functions as it was deployed on Google Cloud.

An invocation through Function Framework is a better and closer representation of what will be deployed. If you want to test your service integration and service to service call, function framework if the best tool for that.