dynopoker icon indicating copy to clipboard operation
dynopoker copied to clipboard

How to make this work with heroku-json-server ( Node.js) ?

Open DespertaWeb opened this issue 6 years ago • 1 comments

Hi i'm a pure FE and still very green in the BE side. I was trying to user kaffeine but is not longer working. Then I've heard about this dynopoker, but I assume this is for ruby BE, right? Is there any possibility to port this to Nodejs?

DespertaWeb avatar Aug 20 '18 19:08 DespertaWeb

Hello! dynopoker is ruby only lib with current state, but the idea is really simple: ping itself every 30mins. Since you mentioned Node all basically boils down to:

setInterval(function() { ping(); }, 30*60*1000);

Ping method may look like:

var http = require('http');
function ping() {
  var options = { method: 'HEAD', host: 'github.com', port: 80, path: '/' };
  http.request(options, function(_res) {}).end();
}

kubenstein avatar Aug 31 '18 10:08 kubenstein