changed URI to HOST in api config
This commit is contained in:
parent
c760f1a392
commit
cde3dfbc14
2 changed files with 9 additions and 9 deletions
|
@ -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',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue