<commit_before>var static = require('node-static');
var file = new(static.Server)('./public');
require('http').createServer(function (request, response) {
    request.addListener('end', function () {
        file.serve(request, response);
    });
}).listen(9000);

var Now = require('../../lib/now.js').Now;
now = new Now();

var ChatServer = {
  handle_join: function(name, clientId){
    console.log(name + ' joined');
    now.joinChannel('lobby', clientId);
  },
  handle_message: function(name, message){
   lobby('receive').call(name, message);
  }
}

var lobby = now.getChannel('lobby');
now.joinService('chat', ChatServer);
now.joinChannel('lobby', {
  handle_receive: function(name, message){ <commit_msg>fix pathing so can run chat example server anywhere<commit_after>var static = require('node-static');
var file = new(static.Server)(__dirname+'/public');
require('http').createServer(function (request, response) {
    request.addListener('end', function () {
        file.serve(request, response);
    });
}).listen(9000);

var Now = require(__dirname+'/../../lib/now.js').Now;
now = new Now();

var ChatServer = {
  handle_join: function(name, clientId){
    console.log(name + ' joined');
    now.joinChannel('lobby', clientId);
  },
  handle_message: function(name, message){
   lobby('receive').call(name, message);
  }
}

var lobby = now.getChannel('lobby');
now.joinService('chat', ChatServer);
now.joinChannel('lobby', {
  handle_receive: function(name, message){ 
{'fraction_non_alphanumeric': 0.18463611859838275, 'fraction_numerical': 0.005390835579514825, 'mean_word_length': 4.823529411764706, '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': '4635051', 'n_tokens_mistral': 467, 'n_tokens_neox': 460, 'n_words': 94}