1

do you know where do I need to put the heroku http port in my web app?

The only documentation I can find is: https://devcenter.heroku.com/articles/setting-the-http-port-for-java-applications but I do not use eighter of those options which are in the documentation. I can't find no java maven web application example. The only examples I can find are for node.js.

I deploy my app just by using:

heroku war:deploy warfile.war --app myproject
Lebron11
  • 656
  • 7
  • 18
Jebemti mater
  • 124
  • 12

1 Answers1

0

I am aware of two solutions:

1) At the webpage of Heroku Dev Centre describing the Configuring WAR Deployment with the Heroku CLI, you find the Configuring Tomcat Options which describes commands configuring the way a war file will be executed on the server by setting the WEBAPP_RUNNER_OPTS configuration variable on your application with a wide range of options described at Webapp Runner: Options. You might find the --port interesting that is set to 8080 by default and can be configured like:

heroku config:set WEBAPP_RUNNER_OPTS="--port=9090"

2) Another solution is at Heroku Dev Centre Create a Java Web Application Using Embedded Tomcat.

Basically, it means that the application will be launched on the embedded Tomcat using dependencies. This provides an ability to configure the Tomcat directly at the code-base of your project.

Tomcat tomcat = new Tomcat();
tomcat.setPort(Integer.valueOf("9090"))

// defining context and localizing resources

tomcat.start();
tomcat.getServer().await();
Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183