You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What are the best practices for using Vandium with AWS SAM CLI?
Everything works great when I am using CLI events and Postman to test my endpoints, however when I try to consume endpoints via my client application CORS does not seem to be enabled.
There's an issue that has been raised with the SAM project - not sure if that might help. I would caution against having the lambda code handle the OPTIONS request. Typically it's handled with an API Gateway Mock request
@richardhyatt it seems the doc has been updated to state that if using lambda proxy you must handle your own options request: For a Lambda proxy integration or HTTP proxy integration, you can still set up the required OPTIONS response headers in API Gateway. However, your backend is responsible for returning the Access-Control-Allow-Origin and Access-Control-Allow-Headers headers, because a proxy integration doesn't return an integration response.
What are the best practices for using Vandium with AWS SAM CLI?
Everything works great when I am using CLI events and Postman to test my endpoints, however when I try to consume endpoints via my client application CORS does not seem to be enabled.
I have added this to my handler:
And I have this in my SAM template:
However Vandium does not respond to the pre flight OPTION request, and does not seem to have a method for defining OPTION routes.
I had to make a vanilla lambda to respond to OPTION requests:
What is the right way of dealing with this?
The text was updated successfully, but these errors were encountered: