获得AWS的lambda响应为HTML页面页面、AWS、lambda、HTML

2023-09-11 10:55:27 作者:打小就多情

我怎样才能获得AWS的lambda响应为HTML页面。请提供分步过程来解决前进this.Thanks

How can i get the aws lambda response as the HTML page. Please provide the step wise procedure to solve this.Thanks in advance

推荐答案

简单地存储在 HTML 标记中的一个变量并返回it.To避免因result.please使用输出映射的模板,因为报价变量而已。那么你就可以避开报价。首先你只储存您的 HTML 标记中的的λ函数的变量。然后LAMBDA执行后返回。这里是映射模板的一个例子。

Simply store the HTML markup in a variable and return it.To avoid quotes from the result.please use output mapping template as the variable only. then you can avoid the quotes. first you just store your HTML markup in a variable in lambda function. Then Return it after the execution of Lambda. Here is an example of mapping template.

#设置($ inputRoot = $ input.path('$')) $ inputRoot.variableHTML。

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

下面variableHTML包含您需要创建为HTTP状态的反应模式,通过方法响应HTML markup.after。这里补充响应模型内容类型为text / html。然后你得到的HTML页面没有引号。

here variableHTML contains the HTML markup.after that you needed to create an Response model for http Status, go through Method Response. here add Response model Content-Type as text/html. Then you get the HTML page without quotes.