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

Add invoke for none javascript lambdas #77

Merged
merged 5 commits into from
Jul 29, 2019
Merged

Conversation

brocksamson
Copy link
Contributor

This is inspired by how serverless-offline invokes lambdas. I converted the code to typescript, fixed multiple bugs within the serverless-offline implementation and tried to make sure it was well behaved with a few different scenarios.

Additionally I squashed a few other bugs along the way.

  1. Added support for non promise lambdas (context callbacks).
  2. Added failure responses to the caller + promise.catch
  3. Added some code to avoid Empty Body Sent to HTTP Subscribers s12v/sns#45

amMattM added 3 commits July 25, 2019 13:55
This delegates to serverless invoke and then attempts to
intelligently parse the lambda response from the output
that serverless sends to stdout.
Because all logging also goes to stdout, the response parser
only looks for json objects and arrays.
Wired up context.success | context.fail methods
they will now respond appropriately to the calling server.
Also added promise.catch logic to handle lambda failures
@brocksamson brocksamson changed the title Add invoke for none python lambdas Add invoke for none javascript lambdas Jul 25, 2019
@mj1618 mj1618 merged commit aba6814 into mj1618:master Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants