From 08a8c9526fdc51546de40dfe08637679d5716a3c Mon Sep 17 00:00:00 2001 From: freearhey Date: Thu, 8 Aug 2019 15:56:23 +0300 Subject: [PATCH] Update index.js - added verbose mode - renamed http to instance (to avoid conflict in variable names) --- test/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/index.js b/test/index.js index 5288147dd..be0f94403 100644 --- a/test/index.js +++ b/test/index.js @@ -2,6 +2,7 @@ const util = require('../helpers/util') const axios = require('axios') const https = require('https') +const verbose = true const errorLog = 'error.log' const config = { timeout: 60000, @@ -14,13 +15,13 @@ let stats = { failures: 0 } -const http = axios.create({ +const instance = axios.create({ timeout: config.timeout, httpsAgent: new https.Agent({ rejectUnauthorized: false }) }) -http.defaults.headers.common["User-Agent"] = "VLC/2.2.4 LibVLC/2.2.4" +instance.defaults.headers.common["User-Agent"] = "VLC/2.2.4 LibVLC/2.2.4" async function test() { @@ -52,7 +53,11 @@ async function test() { try { - await http.get(item.url) + if(verbose) { + console.log(`Checking '${item.url}'...`) + } + + await instance.get(item.url) continue