Skip to content

Instantly share code, notes, and snippets.

@mohammed-ali-1
Created March 12, 2019 14:31
Show Gist options
  • Save mohammed-ali-1/8075cada8a347c1dafeb1d308cab5228 to your computer and use it in GitHub Desktop.
Save mohammed-ali-1/8075cada8a347c1dafeb1d308cab5228 to your computer and use it in GitHub Desktop.
OpenWhisk action that adds a message to the readings database
function action(args) {
var request = require('sync-request');
var res = request('POST', 'http://COUCHDB_HOST:COUCHDB_PORT_NUMBER/readings/', {
json: {reading: args},
headers: {
'Content-Type': 'application/json',
},
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment