GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs

Expose an invoke function

Offen
#372 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement P3
Vorherrschende Sprache
TypeScript
Sterne
1.4k
Forks
181
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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);
});
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.