Created
September 6, 2018 10:07
-
-
Save noriyukitakei/8328022feb7481f126ee178ebbdb9f0f to your computer and use it in GitHub Desktop.
【多分わかりやすいサーバーレスアーキテクチャ入門 〜 「Azure Functions」を使って、クラウドネイティブなLINE風チャットアプリを作ろう!! 〜 】getMessageList
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
module.exports = function (context, req) { | |
// このオブジェクトの中にCosmos DBに対して、 | |
// クエリ「SELECT * FROM c order by c.pubDate asc」を発行した結果が入ります。 | |
var documents = context.bindings.inputDocument; | |
// 先程CosmosDBから取得したJOSNをHTTPレスポンスとして返します。 | |
context.res = { | |
status: 202, | |
headers: { | |
"Content-Type": "application/json", | |
}, | |
body: documents | |
}; | |
context.done(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment