You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
387 B
20 lines
387 B
const rp = require('request-promise');
|
|
|
|
const baseUrl = 'https://onionoo.torproject.org/';
|
|
const endpoints = [
|
|
'summary',
|
|
'details',
|
|
'bandwidth',
|
|
'weights',
|
|
'clients',
|
|
'uptime'
|
|
];
|
|
|
|
module.exports = endpoints.reduce((onionoo, endpoint) => {
|
|
onionoo[endpoint] = args => rp({
|
|
uri: `${baseUrl}${endpoint}`,
|
|
qs: args,
|
|
json: true
|
|
});
|
|
return onionoo;
|
|
}, {});
|
|
|