<commit_before>"use strict";
const Hapi = require('hapi');
const Wreck = require('wreck');
const server = new Hapi.Server();
const baseURI    = 'http://pokeapi.co/api/v1/';
const SECOND = 1000;

const index = function index(request,reply){
  Wreck.get(baseURI,null,function(err,response,payload){
    reply( err || JSON.parse(payload));
  });
};

const pokedex = function pokedex(request,reply){
  server.methods.getPokedex(function(err, result) {
   reply(err || result);
  });
};

const getPokedex = function (next){
  console.log('Getting pokedex data');
  Wreck.get(`${baseURI}pokedex/1/`,null,function(err,response,payload){
    if (err){
      next(err);
    } else {
      next(null, JSON.parse(payload));
    }
  });
}

server.connection({
  host:'localhost',
  port: Number(process.argv[2] || 8080)
});
<commit_msg>Removed host option. Fixed port value<commit_after>"use strict";
const Hapi = require('hapi');
const Wreck = require('wreck');
const server = new Hapi.Server();
const baseURI    = 'http://pokeapi.co/api/v1/';
const SECOND = 1000;
const PORT = process.env.port || 8080;

const index = function index(request,reply){
  Wreck.get(baseURI,null,function(err,response,payload){
    reply( err || JSON.parse(payload));
  });
};

const pokedex = function pokedex(request,reply){
  server.methods.getPokedex(function(err, result) {
   reply(err || result);
  });
};

const getPokedex = function (next){
  console.log('Getting pokedex data');
  Wreck.get(`${baseURI}pokedex/1/`,null,function(err,response,payload){
    if (err){
      next(err);
    } else {
      next(null, JSON.parse(payload));
    }
  });
}

server.connection({
  port: PORT
});

{'fraction_non_alphanumeric': 0.17668269230769232, 'fraction_numerical': 0.012620192307692308, 'mean_word_length': 4.423452768729642, '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': '1382926', 'n_tokens_mistral': 591, 'n_tokens_neox': 573, 'n_words': 113}