In the last article, I covered the basics of creating Lambda functions on AWS, using the CDK. In this article, I will cover how to store data in a ...
For further actions, you may consider blocking this person and/or reporting abuse
Just a small suggestion - when creating an API, it's better to include details as to why validation failed instead of just returning a generic error message. At the very least, this code:
Would be vastly improved by this simple change:
Indeed! I tried to keep it simple in these examples. To go even further, a better typing should be used instead of hard coding the input and output types. I plan to cover the use of contracts one day
How did you deploy the code in required lambda using cdk code.. would like to know more on those points as well. Thanks
I covered the subject with more details in the previous article of the series. Basically the Nodejsfunction construct allows you to write code in a separate file and will handle deployment for you !
I wished someone had taught me how to partionned a DynamoDB when I started
Partitioning a DB is easier said than done 😩
Shouldn't the handler function return a promise?
Yes, but it does here -> async functions that contain an "await" statement automatically return a promise, even if it ins't stated explicitly.
If you write the code and check the return type, you will see that it's a promise
classic use case, it's super valuable to have these code examples, thanks for sharing!
Thank you! I’m glad you found this useful 🤗
Excellent content. I tried the homework, DELETE was actually the same than GET. Update and creation might rely on the existence of noteId to use or create a new uuid 😎