Skip to content

Instantly share code, notes, and snippets.

@glauberramos
Created October 5, 2015 21:09
Show Gist options
  • Save glauberramos/fe8a5e8d9ba1f91f2700 to your computer and use it in GitHub Desktop.
Save glauberramos/fe8a5e8d9ba1f91f2700 to your computer and use it in GitHub Desktop.
ajaxNode
var http = require('http');
var server = http.createServer(function (request, response) {
function funcOne(input) {
var request = require('request');
request.get('http://estruturaorganizacional.dados.gov.br/id/unidade-organizacional/1930',
{json: true, body: input},
function(err, res, body) {
if (!err && res.statusCode === 200) {
console.log(err);
console.log(res);
console.log(body);
}
});
}
funcOne();
});
server.listen(8000);
console.log("Server running at http://127.0.0.1:8000/");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment