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.
16 lines
358 B
16 lines
358 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 });
|
|
return onionoo;
|
|
}, {});
|
|
|