emulator
emulator copied to clipboard
Add http event support for Google Cloud Functions
Right now we only support the (event, callback)
function signature for Google Cloud Functions.
However Google support the (request, response)
function signature for http
events. The emulator should support this type of function as well.
Since request
and response
are Express objects (see Google Docs here) we can simply add the express
npm
package as a dependency and update the Google Middleware to pass the request
and reponse
objects as the function parameters.
The middleware-part which needs to be updated can be found here (an if-else which checks for the event type can be implemented so that the functionParams
for the http
functions are computed as well).
/cc @ac360 @mthenw