JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
print fs open/read error
[peach-cgt.git] / server.coffee
index 44084e8..db252bd 100644 (file)
@@ -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/>.
 
-listen_port = 13850
+listen_port = process.env.app_port ? 9988
 sys = require 'sys'
 fs = require 'fs'
 http = require 'http'
@@ -104,7 +104,7 @@ js_handler = (args, out, request, url_parts) ->
 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/_.-]')