Created
March 12, 2019 14:31
-
-
Save mohammed-ali-1/8075cada8a347c1dafeb1d308cab5228 to your computer and use it in GitHub Desktop.
OpenWhisk action that adds a message to the readings database
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
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