This commit is contained in:
Begerad, Stefan 2021-09-09 10:11:43 -04:00
parent 06abf48a86
commit ab878373f3
2 changed files with 19 additions and 4 deletions

View File

@ -11,6 +11,18 @@ debug('USR: '+USR)
const KEY=process.env.KEY||'KEY';
debug('KEY: '+KEY)
/**
* Disable server authorization only in development mode
*/
if (process.env.NODE_ENV === 'development') {
const https = require('https');
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
})
axios.defaults.httpsAgent = httpsAgent
debug('%s RejectUnauthorized is disabled.',process.env.NODE_ENV)
}
run().catch(err => {
debug('run: error')
console.log(err)
@ -30,8 +42,10 @@ async function run() {
username: `${USR}`,
password: `${KEY}`
}
});
res.status; // 200
}
).then(res => res.data);
// );
// res.status; // 200
debug('data received via GET');
debug('dataGet len: %s',dataGet.length)

View File

@ -4,12 +4,13 @@
"description": "",
"main": "index.js",
"scripts": {
"dev": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"dev": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Stefan Begerad",
"license": "GPL-3.0",
"devDependencies": {
"https": "^1.0.0",
"nodemon": "^2.0.7"
},
"dependencies": {