updated server.js to work for heroku ports etc