2017-03-30 13:59:37 +03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var request = require("request");
|
|
|
|
|
|
|
|
get('/api/persons/2948', function(data) {
|
2017-03-30 14:12:43 +03:00
|
|
|
console.log(data);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-30 13:59:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// helper function
|
|
|
|
function get(url, cb) {
|
|
|
|
request('http://localhost:3000' + url, function(error, response, body) {
|
|
|
|
cb(JSON.parse(body));
|
|
|
|
});
|
|
|
|
}
|