<commit_before>americano = require 'americano'
fs        = require 'fs'
path      = require 'path'
realtimer = require './utils/realtimer'

localizationManager = require './utils/localization_manager'

useBuildView = fs.existsSync path.resolve(__dirname, 'views', 'index.js')

config =
    common:
        set:
            'view engine': if useBuildView then 'js' else 'jade'
            'views': path.resolve __dirname, 'views'
        engine:
            js: (path, locales, callback) ->
                callback null, require(path)(locales)
        use:[
            americano.bodyParser()
            americano.methodOverride()
            americano.errorHandler
                dumpExceptions: true
                showStack: true
            americano.static path.resolve(__dirname, '/../client/public'),
                maxAge: 86400000
        ]
        afterStart: (app, server) ->
            sio = require 'socket.io'
            app.io = sio server

            app.io.on 'connection', (socket) ->
                realtimer.set(socket)<commit_msg>Fix typo that prevented assets from being loaded<commit_after>americano = require 'americano'
fs        = require 'fs'
path      = require 'path'
realtimer = require './utils/realtimer'

localizationManager = require './utils/localization_manager'

useBuildView = fs.existsSync path.resolve(__dirname, 'views', 'index.js')

config =
    common:
        set:
            'view engine': if useBuildView then 'js' else 'jade'
            'views': path.resolve __dirname, 'views'
        engine:
            js: (path, locales, callback) ->
                callback null, require(path)(locales)
        use:[
            americano.bodyParser()
            americano.methodOverride()
            americano.errorHandler
                dumpExceptions: true
                showStack: true
            americano.static path.resolve(__dirname, '../client/public'),
                maxAge: 86400000
        ]
        afterStart: (app, server) ->
            sio = require 'socket.io'
            app.io = sio server

            app.io.on 'connection', (socket) ->
                realtimer.set(socket)
{'fraction_non_alphanumeric': 0.10734200743494424, 'fraction_numerical': 0.007434944237918215, 'mean_word_length': 1.8899328859060402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1835655', 'n_tokens_mistral': 598, 'n_tokens_neox': 570, 'n_words': 144}