Setting up a new resource and method

First, we need to create a new API Gateway resource and method for the get_comments_by_post_id endpoint. The steps are the same as the prior section. The only differences will be:

  • The endpoint we'll talk to will be https://jsonplaceholder.typicode.com/comments rather than the /posts endpoint
  • We'll need to map query parameters from the initial client request to the desired query parameters to the backend API that provides the data

After setting up this new resource and method, it should look like the following:

Get Serverless Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.