21 lines
300 B
JavaScript
Executable File
21 lines
300 B
JavaScript
Executable File
'use strict';
|
|
|
|
const http = require('./http');
|
|
|
|
const sleep = 5000;
|
|
const timeout = 1000;
|
|
|
|
async function init() {
|
|
try {
|
|
const res = await http.get(`https://httpstat.us/200?sleep=${sleep}`, {
|
|
timeout,
|
|
});
|
|
|
|
console.log(res.statusCode);
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
}
|
|
|
|
init();
|