2 changed files with 19 additions and 1 deletions
@ -0,0 +1,16 @@ |
|||||
|
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; |
||||
|
}, {}); |
Loading…
Reference in new issue