I am calling the create API and have hardcoded the string to test out my API right now:
async function createProfile(param) {
//apiName first param coming from index.js
//path second param coming from endpoint path
const jsonData = "{\"content\":\"hello world\",\"attachment\":\"hello.jpg\"}";
return API.post('notes', '/notes', {
body: jsonData
});
}
But when I check dynamoDB, all I see is an entry created with just the userId and createdDate. There’s no content or attachment values populated from the above jsonData.
I can see this in the cloud watch logs which means the request is making through. But again no data in dynamoDB:
(4ce87038-204b-4d46-982b-15add74b9e5a) Method request body before transformations: "{\"content\":\"hello world\",\"attachment\":\"hello.jpg\"}"
Any idea where I might be wrong and is there any way to debug the serverless create endpoint by stepping through it in some IDE?
Well on the frontend we are using the Amplify AWS library. It’ll convert it to a string. That example is from when we were testing the Lambda function directly.
If you are having problems with the page redirecting and you’re using Firefox Quantum, use Chrome or any Chromium-based browser. Firefox have this thing where it doesn’t allow CORS to run locally because it’s on HTTP instead of HTTPS
Hello Team , First of all Thank you so much for creating and maintaining this project.
This is an amazing work !
I have been working on adding more features to the that implementation and have a question about amplify Storage data upload.
I noticed that you guys use 5MBs of max file size and understand its probably more or less related to S3 max chunk size upload which is also 5MB.
However if you needed to upload files that are larger that 5MBs how would you go about this. Because after removing the limitation in React i still get an error from amazon :
[50:08.104 AWSS3Provider ManagedUpload - error happened while finishing the upload. Cancelling the multipart upload Error: Request failed with status code 400]
it would be great if someone has worked on this and can help… anyway i have a meeting with amazon support this week and will post here any updates later on.
hey Jay, yes. I ended up talking to aws support. Amplify does not support file upload larger than 5gb(this is called multipart upload). I had to use lambda. This is a really bad limitation of amplify.
well in my case , i guess unlucky users upload audio conversations for analysis and they are sometimes larger. But its not so bad because i found a workaround with lambda.
hi everyone. i’m getting a CORS issue when I try to add a note (no attachment yet). The weird thing is, the data is going in the database. But I get Network Error returned to me. Please see attached screenshot
Hi, I tried redoing everything from the start but I got stumped by this same issue - “No ‘Access-Control-Allow-Origin’ header is present on the requested resource”. During my tests, my backend works well, but when I use it with the create frontend, I get this error. I know it’s calling the Lambda function because the data is being displayed in Dynamo DB. Any leads please? Thank you.