Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AWS HTML Lambda Settings

Lambda HTML Response

Method Response

  1. Navigate to the Method Response for the API's GET method.
  2. Open up the 200 under HTTP Status and add a Response Header named Content-Type.
  3. Delete the application/json Response Model for 200.

Integration Response

  1. Navigate to the Integration Response for the API's GET method.

  2. Open up the 200 Response, Header Mappings, and Mapping Templates.

  3. Edit the Response HeaderContent-Type and set the Mapping value to 'text/html' (be sure to use single quotes).

  4. Delete the application/json Content-Type under Mapping Templates.

  5. Add the Content-Type text/html (no quotes this time).

  6. Select Mapping Template in the right-hand drop-down box.

  7. Set the value of Template to

    #set($inputRoot = $input.path('$'))
    $inputRoot.body
    

*Use lambda proxy integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment