Skip to content

Instantly share code, notes, and snippets.

@noriyukitakei
Created September 6, 2018 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noriyukitakei/8328022feb7481f126ee178ebbdb9f0f to your computer and use it in GitHub Desktop.
Save noriyukitakei/8328022feb7481f126ee178ebbdb9f0f to your computer and use it in GitHub Desktop.
【多分わかりやすいサーバーレスアーキテクチャ入門 〜 「Azure Functions」を使って、クラウドネイティブなLINE風チャットアプリを作ろう!! 〜 】getMessageList
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