Amazon API Gateway – JSON形式のレスポンスをHTML形式に加工して返してみる
JAWS-UG 千葉支部 Vol.5 ~秋のAWS Lambda & API Gateway 祭り!!~ の参加メモ
Amazon API Gateway で気になった機能をまとめてみる
API Gateway マッピングテンプレートについて(英語)
JAWSフレームワーク
Last active
October 15, 2015 19:14
-
-
Save sakapun/c516157fa4e8dbf01729 to your computer and use it in GitHub Desktop.
JAWS長岡20151013 サンプルコピペソース集
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "sakapun", | |
"email": "sakapun5th@gmail.com" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://jsonplaceholder.typicode.com/users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set($inputRoot = $input.path('$')) | |
<html> | |
<body> | |
<table border="1"> | |
<tr> | |
<td>name</td><td>email</td> | |
</tr> | |
#foreach($elem in $inputRoot) | |
<tr> | |
<td>"$elem.name"</td> | |
<td>"$elem.email"</td> | |
</tr> | |
#end | |
</table> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = function(event, context) { | |
var name = (event.name === undefined ? 'No-Name' : event.name); | |
var email = (event.email === undefined ? 'No-Email' : event.email); | |
context.done(null, [{"name": name, "email": email}]); // SUCCESS with message | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment