Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
peach-cgt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add debugging
[peach-cgt.git]
/
server.coffee
diff --git
a/server.coffee
b/server.coffee
index
7d8063c
..
c459f44
100644
(file)
--- 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 <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-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'
sys = require 'sys'
fs = require 'fs'
http = require 'http'
@@
-273,6
+273,7
@@
http_server = http.createServer (req, res) ->
url_parts.query = {}
rel_path = url_parts.pathname.substr 1
url_parts.query = {}
rel_path = url_parts.pathname.substr 1
+ console.log rel_path
if rel_path.substr(0, 9) is 'external/'
return external_javascript_handler url_parts.query, res, req, url_parts
if rel_path.substr(0, 9) is 'external/'
return external_javascript_handler url_parts.query, res, req, url_parts
@@
-307,5
+308,5
@@
process.chdir __dirname
setInterval expire_old_games, 2 * 60 * 1000 # check every 2 minutes for expired games
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}/"
console.log "Server running at http://127.0.0.1:#{listen_port}/"