How to get aws lambda response as an HTML page

0 votes

How can I get the AWS Lambda response as the HTML page? Please provide the stepwise procedure to solve this.

Dec 4, 2018 in AWS by datageek
• 3,040 points
129 views

1 answer to this question.

0 votes

Store the HTML markup in a variable and return it to avoid the text being wrapped in quotes. First store your HTML markup in a variable in the lambda function then return it. For example in Node.js:

context.succeed({ variableHTML: myContentHtml })

Here is an example of the mapping template:

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

Here variable HTML contains the HTML markup passed from the lambda function. After that, you needed to create a Response model for HTTP Status, which is accessible through Method Response. Here set the Response model Content-Type as text/html. Then you'll get the HTML page without quotes and the browser recognizes it as HTML.

answered Dec 4, 2018 by Archana
• 5,560 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I add python libraries to an AWS lambda function for Alexa?

As it is described in the Amazon ...READ MORE

answered Oct 23, 2018 in AWS by Archana
• 4,090 points
524 views
0 votes
1 answer
0 votes
1 answer
+2 votes
3 answers
+1 vote
1 answer

How to make an application private on AWS Elastic Beanstalk?

Like you said by default, your application ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,560 points
41 views
0 votes
1 answer