From 84edf4b6bf806f2ec023a0eef3ec475923a867d5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 30 Oct 2022 02:01:03 +0300 Subject: Read http parameters from the config --- vnext/server/http.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vnext/server/http.js b/vnext/server/http.js index 74c51b0a..c2557108 100644 --- a/vnext/server/http.js +++ b/vnext/server/http.js @@ -1,4 +1,5 @@ import axios from 'axios'; +import config from 'config'; var debug = require('debug')('http'); @@ -32,9 +33,9 @@ export const deleteSubscribers = async (tokens) => { return response.data; }; -const baseURL = process.env.JUICK_SERVICE_URL; -const user = process.env.JUICK_SERVICE_USER; -const password = process.env.JUICK_SERVICE_PASSWORD; +const baseURL = config.get('service.baseURL') || process.env.JUICK_SERVICE_URL; +const user = config.get('service.user') || process.env.JUICK_SERVICE_USER; +const password = config.get('service.password') || process.env.JUICK_SERVICE_PASSWORD; /** @type { import('axios').AxiosInstance } */ let client = axios.create({ -- cgit v1.2.3