api-lambda-save-dynamodb
api-lambda-save-dynamodb copied to clipboard
Deploy instantly on Serverless Application Repository
The function in index.js is not idempotent and may insert multiple duplicate records into database. ``` item[PRIMARY_KEY] = uuidv4(); const params = { TableName: TABLE_NAME, Item: item } try {...
This pull request is aimed to fix the idempotence bug described in issue #7 .
Change to using environment variable CORS_ORIGIN instead of a hard coded '*'.
event.httpMethod always returns null , so update this mthod to : event.requestContext.http.method