<commit_before>config = require 'config'

Hapi = require 'hapi'
Good = require 'good'
Lout = require 'lout'

root = require './plugins/root'
registration = require './plugins/registration'

console.log('env port is ' + process.env.PORT);
server = new Hapi.Server 'localhost', process.env.PORT || config.port

module.exports.startServer = (cb) ->

  server.pack.register [
      {plugin: Good}
      {plugin: Lout}
      {plugin: root}
      {plugin: registration}
    ],
    (err) ->
      if err
        throw err

      server.start ->
        cb(null, server)
<commit_msg>fix heroku deploy with hapi<commit_after>config = require 'config'

Hapi = require 'hapi'
Good = require 'good'
Lout = require 'lout'

root = require './plugins/root'
registration = require './plugins/registration'

server = new Hapi.Server '0.0.0.0', process.env.PORT || config.port

module.exports.startServer = (cb) ->

  server.pack.register [
      {plugin: Good}
      {plugin: Lout}
      {plugin: root}
      {plugin: registration}
    ],
    (err) ->
      if err
        throw err

      server.start ->
        cb(null, server)

{'fraction_non_alphanumeric': 0.13824057450628366, 'fraction_numerical': 0.003590664272890485, 'mean_word_length': 2.67986798679868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1141389', 'n_tokens_mistral': 361, 'n_tokens_neox': 352, 'n_words': 94}