# 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 = 8333
+listen_port = process.env.app_port ? 9988
sys = require 'sys'
fs = require 'fs'
http = require 'http'
games = {}
max_concurrent_games = 50
-max_game_idle = 2 * 60 * 60 * 1000 # two hours (in miliseconds)
+max_game_idle = 3 * 60 * 60 * 1000 # three hours (in miliseconds)
# timeout function with args in convenient order
timeout = (ms, func) -> setTimeout func, ms
html_handler = (args, out, request, url_parts) ->
fs.readFile 'index.html', 'utf8', (err, data) ->
if err
- return out.end 'Server failed to read index.html'
+ return out.end "Server failed to read index.html: #{err}"
out.end data
clean_pathname_regex = new RegExp('[^a-zA-Z/_.-]')