Skip to content

Commit b210e80

Browse files
authored
Create visit.js
0 parents  commit b210e80

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

scripts/visit.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const axios = require('axios');
2+
3+
// URL to visit
4+
const url = 'https://github.com/yashksaini-coder'; // Replace with your desired URL
5+
6+
async function visitPage() {
7+
try {
8+
// Send the request 1000 times
9+
for (let i = 0; i < 1000; i++) {
10+
console.log(`Visit ${i + 1} to ${url}`);
11+
await axios.get(url); // Send GET request
12+
}
13+
console.log('Completed 1000 visits');
14+
} catch (error) {
15+
console.error(`Error visiting page: ${error.message}`);
16+
}
17+
}
18+
19+
// Execute the function
20+
visitPage();

0 commit comments

Comments
 (0)