aws-amplify / aws-amplify/amplify-cli
Default DynamoDB template for functions should have CORS configured properly
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Is this related to a new or existing Amplify category?
function
### Is this related to another service?
DynamoDB
### Describe the feature you'd like to request
When using the default DynamoDB template via `amplify add function`, I get a function without proper CORS configuration.
Leading to:
```
Access to XMLHttpRequest at 'the link*' from origin 'http://localhost:3000/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
```
### Describe the solution you'd like

The template above should be updated to have CORS properly considered.
Potentially with:
`npm install cors`
then in the code:
`app.use(cors())`
### Describe alternatives you've considered
Documentation updates but better to have this "just work".
### Additional context
_No response_
### Is this something that you'd be interested in working on?
- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change
Contributor guide
Assessment
This issue has not been assessed yet.