{8.0.0-new} Deploying to Heroku
Heroku is a platform-as-a-service that allows applications to be quickly hosted
in the cloud.
The
{
web: java -jar target/juneau-examples-rest-springboot-8.0.0-SNAPSHOT.jar
You'll need to sign up for an account on Heroku. Afterwards, you can go to the apps page to create a new application:
https://dashboard.heroku.com/apps
Click the
https://dashboard.heroku.com/new-app
After clicking the
https://dashboard.heroku.com/apps/juneau-examples-rest/deploy/heroku-git
For this example, we'll use the
https://dashboard.heroku.com/apps/juneau-examples-rest/deploy/heroku-git
Next, run the following commands to cd into our Eclipse project and initialize it as a local git repo:
$ cd juneau-examples-rest-springboot/ $ git init
$ cd juneau-examples-rest-springboot/ $ git init Initialized empty Git repository in /.../juneau-examples-rest-springboot/.git/
Next, run the following command to link our project to the Heroku app:
$ heroku git:remote -a juneau-examples-rest
$ heroku git:remote -a juneau-examples-rest set git remote heroku to https://git.heroku.com/juneau-examples-rest.git
Next, run the following commands to add our files to the git repo and push to the Heroku master branch:
$ git add . $ git commit -am "Initial deploy" $ git push heroku master
$ git add . master (root-commit) 7c94cb9] Initial deploy 123 files changed, 11986 insertions(+) Counting objects: 127, done. $ git commit -am "Initial deploy" $ git push heroku master Delta compression using up to 8 threads. Compressing objects: 100% (113/113), done. Writing objects: 100% (127/127), 363.91 KiB | 21.41 MiB/s, done. ... remote: -----> Compressing... remote: Done: 85.9M remote: -----> Launching... remote: Released v3 remote: https://juneau-examples-rest.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. To https://git.heroku.com/juneau-examples-rest.git * [new branch] master -> master
If no errors were shown, then our application should now be live.
You can click on the
If everything worked, your browser should now be loaded with our example REST app:
https://juneau-examples-rest.herokuapp.com