I’m having a hard time adding Access-Control-Allow-Origin to my GET method with serverless. When I enabled CORS on resource root, I expect all of my methods will have Access-Control-Allow-Origin header under Method Response. This usually happens when I enable CORS from API GW dashboard.
Additional info: For API created by serverless, enabling CORS via Console would also fail for any of my method due to missing a response body:
This is created automatically if you create new method manually from console, however serverless doesn’t create it.
Update: here’s the API config from serverless.yml
- http: path: /myapi method: GET cors: true
This creates an OPTION method with CORS enabled, but nothing gets created on GET method.