Creating the Retrieve Lambda

Overview

Next, we’ll retrieve information about a reservation. To do that, we’ll probably have to pass in two bits of information into the Lambda, namely the userId and hotelId. But that might return multiple results if a user has stayed in the hotel before. So, we’ll also pass in the start date of the stay. Because we’re retrieving information but not actually changing anything, the correct HTTP method is GET.

Setup

Create a new directory called retrieve under the Lambdas directory. Copy the webpack config, jest config, and tsconfig from the other Lambda. Those remain the same. The package.json is very similar:

Get hands-on with 1400+ tech skills courses.