var request = require('request');

var config = require('../config.json');
var log = require('./log.js');

function post() {
  var url = 'http://127.0.0.1:' + config.ACTIVITY_SERVER.PORT + '/blink';
  request.post(url, function(err, response, body) {
    if(err) {
      log.error('Error reporting activity to ACTIVITY_SERVER');
      log.error(err);
      return;
    }

    log.debug('ACTIVITY_SERVER result: ' + body);
    response.destroy();
  });
}

module.exports.post = post;

var request = require('request');

var config = require('../config.json');
var log = require('./log.js');

function post() {
  if(!config.ACTIVITY_SERVER.POST) return;
  
  var url = 'http://127.0.0.1:' + config.ACTIVITY_SERVER.PORT + '/blink';
  request.post(url, function(err, response, body) {
    if(err) {
      log.error('Error reporting activity to ACTIVITY_SERVER');
      log.error(err);
      return;
    }

    log.debug('ACTIVITY_SERVER result: ' + body);
    response.destroy();
  });
}

module.exports.post = post;

Add missing ACTIVITY_SERVER config switch
Add missing ACTIVITY_SERVER config switch
