<commit_before>var bitcoin = require('bitcoin');
var express = require('express');

module.exports = function(){

  function express_app(){
    var app = express();
    
    app.get('*', hasAccess, function(req, res){
      var method = req.path.substring(1,req.path.length);

      if('undefined' != typeof requires_passphrase[method]){
        if(wallet_passphrase) client.walletPassphrase(wallet_passphrase, 10);
        else res.send('A wallet passphrase is needed and has not been set.');
      }

      var query_parameters = req.query;
      var params = [];

      for(var parameter in query_parameters){
        if(query_parameters.hasOwnProperty(parameter)){
          var param = query_parameters[parameter];
          if(!isNaN(param)){
            param = parseFloat(param);
          }
          params.push(param);
        }
      }

      var command = [];
      if(method == "sendmany"){
        command = specialApiCase('sendmany');
      }
      else{
        command = [{
          method: method,
          params: params
        }];
      }
      console.log("Recived command: "+command);

      client.cmd(command, function(err, response){
        if(err){console.log(err); res.send("There was an error. Check your console.");}
        else{
          if(typeof response === 'object'){
            res.send(response);
          }
          else{
            res.send(""+response);<commit_msg>API method Test<commit_after>var bitcoin = require('bitcoin');
var express = require('express');

module.exports = function(){

  function express_app(){
    var app = express();
    
    app.get('*', hasAccess, function(req, res){
      var method = req.path.substring(1,req.path.length);

      if('undefined' != typeof requires_passphrase[method]){
        if(wallet_passphrase) client.walletPassphrase(wallet_passphrase, 10);
        else res.send('A wallet passphrase is needed and has not been set.');
      }

      var query_parameters = req.query;
      var params = [];

      for(var parameter in query_parameters){
        if(query_parameters.hasOwnProperty(parameter)){
          var param = query_parameters[parameter];
          if(!isNaN(param)){
            param = parseFloat(param);
          }
          params.push(param);
        }
      }

      var command = [];
      if(method == "sendmany"){
        command = specialApiCase('sendmany');
      }
      else{
        command = [{
          method: method,
          params: params
        }];
      }
      console.log("Recived command: "+JSON.stringify(command));

      client.cmd(command, function(err, response){
        if(err){console.log(err); res.send("There was an error. Check your console.");}
        else{
          if(typeof response === 'object'){
            res.send(response);
          }
          else{
            res.send(""+response);
{'fraction_non_alphanumeric': 0.13448033707865167, 'fraction_numerical': 0.002106741573033708, 'mean_word_length': 2.252283105022831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6122064', 'n_tokens_mistral': 787, 'n_tokens_neox': 776, 'n_words': 175}