I need to call an API continuously from server side itself, so that it is called 24/7 every second. How can I achieve this?
I tried it as shown below in server.js, but getting 'TypeError: request.put is not a function'.
app.get('/',function(request,response){
setInterval(function(){
request.put('http://localhost:4242/changepaidstatus', function(error,response){
if (error){
console.log(error);
}
else{
console.log(response);
}
});
}, 1000);
});