Skip to content

Instantly share code, notes, and snippets.

@tribou
Last active August 29, 2015 14:24
Show Gist options
  • Save tribou/0ec5c1c3d94a2cbe9bf3 to your computer and use it in GitHub Desktop.
Save tribou/0ec5c1c3d94a2cbe9bf3 to your computer and use it in GitHub Desktop.
// Random User API logic
var TodoServerActions = require('../actions/TodoServerActions');
var request = require('superagent');
module.exports = {
get: function() {
request.get('http://api.randomuser.me/')
.set('Accept', 'application/json')
.end(function(err, response) {
if (err) return console.error(err);
TodoServerActions.receiveRandom(response.body);
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment