Last active
May 15, 2017 17:09
-
-
Save glennblock/af167c7c34b6f4867e49d252057dedae to your computer and use it in GitHub Desktop.
simple-json-webtask
This file contains hidden or 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
// You can require 1000+ Node.js modules here. Search the full list here: https://tehsis.github.io/webtaskio-canirequire/ | |
var request = require('request'); | |
module.exports = function(ctx, cb) { | |
// Call to forismatic's API to get a random quote | |
request.get( | |
{ | |
uri:'http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json', | |
json: true | |
}, (err,resp, body) => { | |
cb(null, body); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment