lambda-api
lambda-api copied to clipboard
"error": "Method not allowed"
When i am hitting the route its returning "method not allowed"
@jthomerson @jeremydaly help me pls
Hey @raja-vcomply!
Can you post some sample code?
@raja-vcomply - I just ran into this too. I was using API Gateway V2, but it appears lambda-api won't support the v2.0 event payload format until 0.11
per this comment:
v0.11 supports Payload V2 and should be available shortly.
Originally posted by @jeremydaly in https://github.com/jeremydaly/lambda-api/issues/174#issuecomment-808725167
If this sounds like your case, you can force the API Gateway V2 to use the v1.0 payload format in the settings. I also noticed the new $default
route did not work with lambda-api, and had to configure /
and /{proxy+}
routes instead.
If I understand the situation correctly @codyfyi, I believe it does support v2.0 events. Your code should be this.
const app = api.default({version: 'v2.0'});