<commit_before>var _         = require('lodash');
var uuid      = require('node-uuid');
var serverlib = require('./../lib/server-lib');
var remote    = require('./../lib/remote.js');
var respond   = require('./../lib/response-handler.js');
var errors    = require('./../lib/errors.js');

module.exports.serverStatus = getServerStatus;

function getServerStatus(request, response, next) {
  serverlib.getStatus(remote, function(error, status) {
    if (error) {
      return next(new errors.RippledNetworkError(error.message));
    }

    respond.success(response, _.extend({
      api_documentation_url: 'https://github.com/ripple/ripple-rest'
    }, status));
  });
};

/**
 *  Check server connectivity.  If we hit this method it means the server is
 *  connected, as per middleware
 */

module.exports.isConnected = getServerConnected;

function getServerConnected(request, response, next) {
  respond.success(response, { connected: true });
};

/**
 * Get UUID, for use by the client as transaction identifier
 */

module.exports.uuid = getUUID;

function getUUID(request, response, next) {
  respond.success(response, { uuid: uuid.v4() });
};

/**
 * Get the current transaction fee
 */

module.exports.fee = getFee;

function getFee(request, response, next) {
  var fee = remote.createTransaction()._computeFee();

  respond.success(response, { fee: fee });
};<commit_msg>Export things at the bottom<commit_after>var _         = require('lodash');
var uuid      = require('node-uuid');
var serverlib = require('./../lib/server-lib');
var remote    = require('./../lib/remote.js');
var respond   = require('./../lib/response-handler.js');
var errors    = require('./../lib/errors.js');

function getServerStatus(request, response, next) {
  serverlib.getStatus(remote, function(error, status) {
    if (error) {
      return next(new errors.RippledNetworkError(error.message));
    }

    respond.success(response, _.extend({
      api_documentation_url: 'https://github.com/ripple/ripple-rest'
    }, status));
  });
};

/**
 *  Check server connectivity.  If we hit this method it means the server is
 *  connected, as per middleware
 */

function getServerConnected(request, response, next) {
  respond.success(response, { connected: true });
};

/**
 * Get UUID, for use by the client as transaction identifier
 */

function getUUID(request, response, next) {
  respond.success(response, { uuid: uuid.v4() });
};

/**
 * Get the current transaction fee
 */

function getFee(request, response, next) {
  var fee = remote.createTransaction()._computeFee();

  respond.success(response, { fee: fee });
};

module.exports.serverStatus = getServerStatus;
module.exports.isConnected = getServerConnected;
module.exports.uuid = getUUID;
module.exports.fee = getFee;
{'fraction_non_alphanumeric': 0.15323455005421033, 'fraction_numerical': 0.0007228044813877846, 'mean_word_length': 3.856140350877193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4061438', 'n_tokens_mistral': 834, 'n_tokens_neox': 829, 'n_words': 200}