Before it was working perfectly on my VPS, but I decided to try Heroku. I successfully deployed by app there, but could not connect to it... Why could it happen? Is there any port setting in Heroku or something?
Asked
Active
Viewed 90 times
0
-
Did you use your own presets port ? or port defined by heroku in process.env.PORT ? – Robert Nov 15 '20 at 18:51
-
Can you share the code please – svikramjeet Nov 16 '20 at 06:24
-
@Robert own port... Do I need to use process.env.PORT instead? But how to share that port with my client for that server? – Wynell Nov 16 '20 at 06:44
-
heroku don't allow to use own port configuration. you have to use this one which heroku expose. try to use there port and connect without passing any in connection string (works for me) – Robert Nov 16 '20 at 07:25
-
https://stackoverflow.com/questions/28706180/setting-the-port-for-node-js-server-on-heroku – Robert Nov 16 '20 at 08:42