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
• 2,830 points
76 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,280 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
• 3,770 points
80 views
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,280 points
21 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.