I am a node.js beginner and I'm trying to check status of domains I read from a csv file. All works fine, however when the script reaches the end it simply hangs and does not quit. Below is the code I'm working with. What am i missing here? Any help would be greatly appreciated!
```
const fs = require('fs');
const request = require('request');
let https = require('https');
const input_path = 'Path_to_csv'
function FetchUrls (callback) {
fs.readFile(input_path, 'utf8', function (err, data) {
let dataArray = data.split(/\r?\n/);
console.log(`loaded ${dataArray.length} items`)
callback(dataArray)});
}
function getData (dataArray) {
let urls = dataArray
for (let url of urls) {
https.get(url, function(res) {
if(res.statusCode == 500) {
console.log("Domain Down")
} else {
console.log("Domain Up")
}
}).on('error', function(e) {
console.log(e)
process.exit()
});
}
}
FetchUrls(function(dataArray) {
getData(dataArray)
})
```