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,090 points
1,621 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,640 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

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

If you get lucky (it depends what ...READ MORE

answered Nov 3, 2020 in AWS by anonymous
15,098 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,640 points
1,933 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP