The error you are facing could be because Heroku adds a / before port number in $PORT Refer to the post below to see how they solved it