X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=server.coffee;h=196a0b844f479b296b2edf6f5c3c15595ec41314;hb=149015223061fdbec2d9cf2c2e59962e6ae783e6;hp=04116575226fcdf7e2ea78d88b70790a0b890b5b;hpb=6c7d84c807fbc385902759c61517c738c390b690;p=peach-cgt.git diff --git a/server.coffee b/server.coffee index 0411657..196a0b8 100644 --- a/server.coffee +++ b/server.coffee @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -listen_port = process.env.app_port ? 9988 +listen_port = process.env.PORT ? process.env.app_port ? 9988 sys = require 'sys' fs = require 'fs' http = require 'http' @@ -302,11 +302,10 @@ 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 -http_server.listen listen_port, "127.0.0.1" +http_server.listen listen_port console.log "Server running at http://127.0.0.1:#{listen_port}/"