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

Process AWS SDK “Invoke” requests #106

Open
jeremydaly opened this issue Apr 20, 2019 · 2 comments
Open

Process AWS SDK “Invoke” requests #106

jeremydaly opened this issue Apr 20, 2019 · 2 comments

Comments

@jeremydaly
Copy link
Owner

There should be a way for Lambda API to process requests that bypass API Gateway and are invoked directly. Support for “RequestResponse” and “Event” invocations should be supported.

@austinfox
Copy link

I have a use case where I would like to use lambda-api for a series of lambdas API Gateway. For testing/development purposes, I am invoking the lambda directly using the AWS Lambda client. When I do invoke the handler directly (setting the logger to debug) I see that the "route" is undefined, which results in a "Method not allowed" response. Are there any current workarounds that might be able to unblock at the moment? Thanks!

@stawecki
Copy link

@austinfox If you want to invoke your lambda-api handler without using API Gateway, you can try passing an event object that is similar to the API Gateway format. The following examples should work a sample requests:

{
  "httpMethod": "GET",
  "path": "/test/path",
}

Sample POST request:

{
  "body": "{\"value\":\"test\"}",
  "httpMethod": "POST",
  "path": "/test/path
}

See Input format of a Lambda function for proxy integration in AWS docs for more details and attributes.

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

4 participants