-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
24 lines (18 loc) · 833 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const processor = require('./processor');
processor.start()
.then(result => {
console.log('processed all items, result:', result);
result.forEach(item => {
if (item.response.error) {
console.warn(`got error on request ${item.request.method}: ${item.request.url}`, item.response.error);
} else {
if (item.response.statusCode !== 200) {
console.warn(`got ${item.response.statusCode} HTTP code on request ${item.request.method}: ${item.request.url}`);
} else {
console.info(`successfully pinged ${item.request.method}: ${item.request.url}, got ${item.response.statusCode} HTTP code`)
}
}
})
}, err => {
console.log(`Error occurred: ${err}`);
});