GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs

Expose an invoke function

Open
#372 0 comments 0 reactions 0 assignees View on GitHub
enhancement P3
Dominant language
TypeScript
Stars
1.4k
Forks
181
PR merge metrics
No merged PRs in 30d

Description

Currently configuring the credentials necessary to invoke another function [requires a lot of boilerplate code](https://cloud.google.com/functions/docs/securing/authenticating#generating_tokens_manually) 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);
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.