且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

关于将网络核心应用程序部署到Heroku服务器

更新时间:2023-02-19 19:12:48

https://devcenter.heroku.com/articles/setting-the-http-port-for-java-applications

这是为Java应用程序编写的,但它适用于Heroku上托管的任何Web应用程序.当您运行Web Worker时,必须将端口绑定到环境变量 $ PORT .您无法指定自定义端口.

this is written for java application but it applies to any web application hosted on Heroku. When you are running a web worker you have to bind the port to the environment variable $PORT. You cannot specify a custom port.

绑定到正确的端口后,这些错误应消失:

Once you bound to the proper port these error should vanish:

Unhandled Exception: System.Net.Sockets.SocketException: Permission denied

然后您的应用程序可能会运行,或者您可能遇到其他错误.如果您以后遇到其他问题,请创建一个新问题.

Your application might then work or you might be experiencing different errors. If you are experiencing later a different issue please create a new question.