This tutorial will have you deploying a Java app in minutes, so that it will be globally accessible instead of just on localhost.
Create a Free Heroku App Account
-
Navigate to the Heroku Dashboard and create a new App.
-
Provide a unique app name and leave all othe things default and click on
create app
-
Heroku provides three method for deployment but we'll just stick to GitHub Deployment for now.
-
Select GitHub, Search for repository and click the
connect
buttom beside it. -
In the Manual Deployment section, select the branch you want to deploy and click on the
Deploy Branch
-
If the deployment is successful it will be display on the page together with a link to visit the app.
-
New app url. Mine is javarestfulapi.herokuapp.com
Instead of manually pushing the Deploy button each time we push our code to GitHub, We can set it such that whenever we push to a particular GitHub branch it should trigger a build for us automatically.