Working on rewrite version 3. Focus on caching for now.

This commit is contained in:
Scott Idem
2022-03-07 18:21:05 -05:00
parent a72cb27ed8
commit 1d7c14dedb
16 changed files with 695 additions and 635 deletions

View File

@@ -109,7 +109,7 @@
let api_update_datetime = Date.now();
let waiting_on_api_token = false;
const secret_key = app_config.api_secret_key;
const api_secret_key = app_config.api_secret_key;
let api_temporary_token = null;
let api_base_url = null; // 'http://api.localhost:5001' 'https://api.oneskyit.com'
@@ -135,8 +135,8 @@
//console.log('****************** LOOP: API Token Loop ******************');
if (app_online && api_update_datetime < Date.now()) {
//let api_temporary_token_result = api_token_request_async(axios, secret_key)
api_temporary_token = await api_token_request_async(axios, secret_key)
//let api_temporary_token_result = api_token_request_async(axios, api_secret_key)
api_temporary_token = await api_token_request_async(axios, api_secret_key)
.then(function (result) {
if (result) {
console.log('Setting temporary API token to axios Authorization header: '+result);