lib/main.js
function ping(req, res) {
  if (url.parse(req.url).pathname == '/ping') {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('OK');
    return true;
  }
  return false;
}
function ping(req, res) {
  if (url.parse(req.url).pathname == '/ping') {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('OK');
    return true;
  }
  return false;
}
function ping ( req , res ) { if ( url . parse ( req . url ) . pathname == '/ping' ) { res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ; res . end ( 'OK' ) ; return true ; } return false ; }
A simple router function that does nothing but respond "OK". Can be used for load balancer health checks, for example.
A simple router function that does nothing but respond OK . Can be used for load balancer health checks for example .