functions-framework-nodejs
functions-framework-nodejs copied to clipboard
Expose an invoke function
Currently configuring the credentials necessary to invoke another function requires a lot of boilerplate code that is difficult to get right. We could easily expose a method in the functions framework that implements this. Proposed API:
import * as functions from '@googelcloud/functions-framework';
functions.http('Foo', (req, res) => res.send('hello!');
functions.http('Bar', async (req, res) => {
const result = await functions.invoke('my-project', 'Foo', {some: 'payload'});
res.send(result);
});