aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/http.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server/http.js')
-rw-r--r--vnext/server/http.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/vnext/server/http.js b/vnext/server/http.js
index c2557108..0ffa8bfe 100644
--- a/vnext/server/http.js
+++ b/vnext/server/http.js
@@ -1,6 +1,7 @@
import axios from 'axios';
import config from 'config';
-var debug = require('debug')('http');
+import debug from 'debug';
+var log = debug('http');
/**
@@ -17,6 +18,7 @@ export function subscribers(params) {
return new Promise((resolve, reject) => {
client.get(`/notifications?${params.toString()}`)
.then(response => {
+ log(`CODE: ${response.status}`);
resolve(response.data);
})
.catch(reason => { reject(reason); });
@@ -33,7 +35,7 @@ export const deleteSubscribers = async (tokens) => {
return response.data;
};
-const baseURL = config.get('service.baseURL') || process.env.JUICK_SERVICE_URL;
+const baseURL = config.get('service.baseURL') + '/api';
const user = config.get('service.user') || process.env.JUICK_SERVICE_USER;
const password = config.get('service.password') || process.env.JUICK_SERVICE_PASSWORD;
@@ -44,4 +46,4 @@ let client = axios.create({
'Authorization': 'Basic ' + Buffer.from(user + ':' + password).toString('base64')
} : {}
});
-debug(`HTTP client initialized with base URL ${baseURL} ${ user? `and ${user} user` : ''}`);
+log(`HTTP client initialized with base URL ${baseURL} ${ user? `and ${user} user` : ''}`);