Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose an invoke function #372

Open
matthewrobertson opened this issue Oct 26, 2021 · 0 comments
Open

Expose an invoke function #372

matthewrobertson opened this issue Oct 26, 2021 · 0 comments

Comments

@matthewrobertson
Copy link
Member

matthewrobertson commented Oct 26, 2021

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);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants