X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=server.coffee;h=1f04280fd3cb65788536a0adff6f58e7677d2941;hb=e2893c4cf45c6b66ec516939ba987685e94c3872;hp=04116575226fcdf7e2ea78d88b70790a0b890b5b;hpb=6c7d84c807fbc385902759c61517c738c390b690;p=peach-cgt.git diff --git a/server.coffee b/server.coffee index 0411657..1f04280 100644 --- a/server.coffee +++ b/server.coffee @@ -20,9 +20,13 @@ fs = require 'fs' http = require 'http' querystring = require 'querystring' url = require 'url' +console.log "required builtins" less = require 'less' +console.log "required less" coffee = require 'coffee-script' +console.log "required coffee-script" model = require './common.coffee' +console.log "required common.coffee" games = {} max_concurrent_games = 50 @@ -302,9 +306,8 @@ http_server = http.createServer (req, res) -> return html_handler url_parts.query, res, req, url_parts ################## INIT #################### -# nodester starts this app with the current working directory set to / and working copy in /app -if process.cwd() is '/' - process.chdir '/app' +# make sure the current working directory is correct +process.chdir __dirname setInterval expire_old_games, 2 * 60 * 1000 # check every 2 minutes for expired games