Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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