diff options
author | Vitaly Takmazov | 2023-01-13 10:28:31 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-14 10:06:45 +0300 |
commit | e3c378cbf1d502263c61d3b9c31cd270bc3ae239 (patch) | |
tree | 9e038f42349671407e6f5906681de6448565f8eb /vnext/server/http.js | |
parent | d94eec89b104e5c839d76c74ce94e83960d49c31 (diff) |
vnext: Telegram bot (WIP)
Diffstat (limited to 'vnext/server/http.js')
-rw-r--r-- | vnext/server/http.js | 8 |
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` : ''}`); |