Merge branch 'master' of github.com:lbryio/spee.ch into split-publish-timing-events

This commit is contained in:
bill bittner 2018-01-23 14:35:35 -08:00
commit 5c4e412fba
2 changed files with 9 additions and 9 deletions

View file

@ -36,7 +36,7 @@ module.exports = {
testChannelPassword: 'password', // password for the test channel testChannelPassword: 'password', // password for the test channel
}, },
api: { api: {
apiUri: 'localhost', apiHost: 'localhost',
apiPort: '5279', apiPort: '5279',
}, },
}; };

View file

@ -1,8 +1,8 @@
const axios = require('axios'); const axios = require('axios');
const logger = require('winston'); const logger = require('winston');
const config = require('../config/speechConfig.js'); const config = require('../config/speechConfig.js');
const { apiUri, apiPort } = config.api; const { apiHost, apiPort } = config.api;
const lbryApiUrl = 'http://' + apiUri + ':' + apiPort; const lbryApiUri = 'http://' + apiHost + ':' + apiPort;
function handleLbrynetResponse ({ data }, resolve, reject) { function handleLbrynetResponse ({ data }, resolve, reject) {
logger.debug('lbry api data:', data); logger.debug('lbry api data:', data);
@ -25,7 +25,7 @@ module.exports = {
logger.debug(`lbryApi >> Publishing claim to "${publishParams.name}"`); logger.debug(`lbryApi >> Publishing claim to "${publishParams.name}"`);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios axios
.post(lbryApiUrl, { .post(lbryApiUri, {
method: 'publish', method: 'publish',
params: publishParams, params: publishParams,
}) })
@ -41,7 +41,7 @@ module.exports = {
logger.debug(`lbryApi >> Getting Claim for "${uri}"`); logger.debug(`lbryApi >> Getting Claim for "${uri}"`);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios axios
.post(lbryApiUrl, { .post(lbryApiUri, {
method: 'get', method: 'get',
params: { uri, timeout: 20 }, params: { uri, timeout: 20 },
}) })
@ -57,7 +57,7 @@ module.exports = {
logger.debug(`lbryApi >> Getting claim_list for "${claimName}"`); logger.debug(`lbryApi >> Getting claim_list for "${claimName}"`);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios axios
.post(lbryApiUrl, { .post(lbryApiUri, {
method: 'claim_list', method: 'claim_list',
params: { name: claimName }, params: { name: claimName },
}) })
@ -74,7 +74,7 @@ module.exports = {
// console.log('resolving uri', uri); // console.log('resolving uri', uri);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios axios
.post(lbryApiUrl, { .post(lbryApiUri, {
method: 'resolve', method: 'resolve',
params: { uri }, params: { uri },
}) })
@ -94,7 +94,7 @@ module.exports = {
logger.debug('lbryApi >> Retrieving the download directory path from lbry daemon...'); logger.debug('lbryApi >> Retrieving the download directory path from lbry daemon...');
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios axios
.post(lbryApiUrl, { .post(lbryApiUri, {
method: 'settings_get', method: 'settings_get',
}) })
.then(({ data }) => { .then(({ data }) => {
@ -113,7 +113,7 @@ module.exports = {
createChannel (name) { createChannel (name) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios axios
.post(lbryApiUrl, { .post(lbryApiUri, {
method: 'channel_new', method: 'channel_new',
params: { params: {
channel_name: name, channel_name: name,