changed URI to HOST in api config

This commit is contained in:
bill bittner 2018-01-23 12:41:39 -08:00
parent c760f1a392
commit cde3dfbc14
2 changed files with 9 additions and 9 deletions

View file

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

View file

@ -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,