I began to develop in Node.js
today and I think an application that performs several requests to know the server uptime. I need every request completion the function is performed again as a while loop.
Is it possible to do this in Node.js?
My basic code
var http = require('http');
var request = require('request');
request({
url: "http://www.google.com",
method: "GET",
timeout: 10000,
followRedirect: true,
maxRedirects: 10
},function(error, response, body){
if(!error && response.statusCode == 200){
console.log('sucess!');
}else{
console.log('error' + response.statusCode);
}
});
PS : Sorry if it's a stupid question or duplicate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With