Skip to content

Expose an invoke function #372

Open
Open
@matthewrobertson

Description

@matthewrobertson

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions