1.0.2 • Published 9 years ago

rstart v1.0.2

Weekly downloads
9
License
MIT
Repository
github
Last release
9 years ago

rstart

A NodeJS health-checker

What does it do?

rStart check if a url is available in a period that you define. If the http response code isn't 200 it exec a bash command, something like restart the nodejs server, whatever.

Example

var rstart = require('rstart');
var checker = new rstart("http://127.0.0.1:31000/", "ls", "* * * * * *");
// \/ if you don't want wait to check use \/
// checker.check();

// receive the response
checker.on('response', function(response, stdout) {
  // do anything with the response and stdout
  // response -> it could be 'OK' or 'FAIL'
  // stdout -> string with the response of the command executed
});

Constructor explained

var checker = new rstart("http://127.0.0.1:31000/", "ls", "* * * * * *");

Arguments in order: