Browse Source

Parse JSON response in API client

pm2
Luke Childs 8 years ago
parent
commit
1d806f7791
  1. 6
      lib/onionoo.js

6
lib/onionoo.js

@ -11,6 +11,10 @@ const endpoints = [
]; ];
module.exports = endpoints.reduce((onionoo, endpoint) => { module.exports = endpoints.reduce((onionoo, endpoint) => {
onionoo[endpoint] = args => rp({ uri: `${baseUrl}${endpoint}`, qs: args }); onionoo[endpoint] = args => rp({
uri: `${baseUrl}${endpoint}`,
qs: args,
json: true
});
return onionoo; return onionoo;
}, {}); }, {});

Loading…
Cancel
Save