diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 09:43:01 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 09:43:01 +0200 |
commit | 8a02bd0433b7101c5ea36e87a4edb63204d2adec (patch) | |
tree | d7ab4b6164aef752c216bd2f22f8b3b270a724b8 /server/lib | |
parent | 9fd540562c356cb54b98861d2d9e7d4fbfcd00e0 (diff) | |
download | PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.gz PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.zst PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.zip |
Add pod list endpoint with pagination, sort...
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/friends.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/friends.ts b/server/lib/friends.ts index c0dd24c53..4cc4a82bf 100644 --- a/server/lib/friends.ts +++ b/server/lib/friends.ts | |||
@@ -334,9 +334,9 @@ function computeWinningPods (hosts: string[], podsScore: { [ host: string ]: num | |||
334 | 334 | ||
335 | function getForeignPodsList (host: string) { | 335 | function getForeignPodsList (host: string) { |
336 | return new Promise< ResultList<FormattedPod> >((res, rej) => { | 336 | return new Promise< ResultList<FormattedPod> >((res, rej) => { |
337 | const path = '/api/' + API_VERSION + '/pods' | 337 | const path = '/api/' + API_VERSION + '/remote/pods/list' |
338 | 338 | ||
339 | request.get(REMOTE_SCHEME.HTTP + '://' + host + path, (err, response, body) => { | 339 | request.post(REMOTE_SCHEME.HTTP + '://' + host + path, (err, response, body) => { |
340 | if (err) return rej(err) | 340 | if (err) return rej(err) |
341 | 341 | ||
342 | try { | 342 | try { |
@@ -357,7 +357,7 @@ function makeRequestsToWinningPods (cert: string, podsList: PodInstance[]) { | |||
357 | 357 | ||
358 | return Promise.map(podsList, pod => { | 358 | return Promise.map(podsList, pod => { |
359 | const params = { | 359 | const params = { |
360 | url: REMOTE_SCHEME.HTTP + '://' + pod.host + '/api/' + API_VERSION + '/pods/', | 360 | url: REMOTE_SCHEME.HTTP + '://' + pod.host + '/api/' + API_VERSION + '/remote/pods/add', |
361 | method: 'POST' as 'POST', | 361 | method: 'POST' as 'POST', |
362 | json: { | 362 | json: { |
363 | host: CONFIG.WEBSERVER.HOST, | 363 | host: CONFIG.WEBSERVER.HOST, |