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