Last active
August 29, 2015 14:24
-
-
Save tribou/0ec5c1c3d94a2cbe9bf3 to your computer and use it in GitHub Desktop.
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
// 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