Closed jzaccone closed 7 years ago
Additionally... I implemented the echo by just printing out the document with the attachment name. Sample response is:
{
"_attachments": {
"IBM_logo6383.png": {
"content_type": "image/png",
"digest": "md5-APSdDZa4Kl44vuL4BQhv2g==",
"length": 9851,
"revpos": 1,
"stub": true
}
},
"_id": "IBM_logo6383.png",
"_rev": "1-8a8fc33a09b0f6c8414c4bc4654bb367"
}
Couple comments about this pull request
1) I tried to use the pre-built openwhisk actions to create the attachment, but it fails if you don't have an existing document to attach to. The openwhisk node module seems to create the document and add the attachment in a single call. 2) I randomly generate new document names to force it to create new documents, the change feed wasn't being triggered otherwise 3) I'm new to node promises, so if any reviewers can think of a better way to rewrite the
write-to-cloudant.js
file, refactorings are welcome!